@ -39,8 +39,8 @@ func TestAPIAdminCreateAndDeleteSSHKey(t *testing.T) {
OwnerID : keyOwner . ID ,
} )
req = NewRequestf ( t , "DELETE" , "/api/v1/admin/users/%s/keys/%d?token=" + token ,
keyOwner . Name , newPublicKey . ID )
req = NewRequestf ( t , "DELETE" , "/api/v1/admin/users/%s/keys/%d?token=%s " ,
keyOwner . Name , newPublicKey . ID , token )
session . MakeRequest ( t , req , http . StatusNoContent )
models . AssertNotExistsBean ( t , & models . PublicKey { ID : newPublicKey . ID } )
}
@ -51,7 +51,7 @@ func TestAPIAdminDeleteMissingSSHKey(t *testing.T) {
session := loginUser ( t , "user1" )
token := getTokenForLoggedInUser ( t , session )
req := NewRequestf ( t , "DELETE" , "/api/v1/admin/users/user1/keys/%d?token=" + token , models . NonexistentID )
req := NewRequestf ( t , "DELETE" , "/api/v1/admin/users/user1/keys/%d?token=%s " , models . NonexistentID , token )
session . MakeRequest ( t , req , http . StatusNotFound )
}
@ -73,8 +73,8 @@ func TestAPIAdminDeleteUnauthorizedKey(t *testing.T) {
session = loginUser ( t , normalUsername )
token = getTokenForLoggedInUser ( t , session )
req = NewRequestf ( t , "DELETE" , "/api/v1/admin/users/%s/keys/%d?token=" + token ,
adminUsername , newPublicKey . ID )
req = NewRequestf ( t , "DELETE" , "/api/v1/admin/users/%s/keys/%d?token=%s " ,
adminUsername , newPublicKey . ID , token )
session . MakeRequest ( t , req , http . StatusForbidden )
}