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