]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/utils/users.js
Server: delete user with the id and not the username
[github/Chocobozzz/PeerTube.git] / server / tests / utils / users.js
index ed7a9d6727871dc833a7e83ff15554aab81d5ef6..3b560e409e4615edf027340b9964bc23e065e3cb 100644 (file)
@@ -52,7 +52,7 @@ function getUsersList (url, end) {
     .end(end)
 }
 
-function removeUser (url, token, username, expectedStatus, end) {
+function removeUser (url, userId, accessToken, expectedStatus, end) {
   if (!end) {
     end = expectedStatus
     expectedStatus = 204
@@ -61,9 +61,9 @@ function removeUser (url, token, username, expectedStatus, end) {
   const path = '/api/v1/users'
 
   request(url)
-    .delete(path + '/' + username)
+    .delete(path + '/' + userId)
     .set('Accept', 'application/json')
-    .set('Authorization', 'Bearer ' + token)
+    .set('Authorization', 'Bearer ' + accessToken)
     .expect(expectedStatus)
     .end(end)
 }