From 68a3b9f2aacb0225ae8b883b561b144bac339cbd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 9 Aug 2016 21:44:45 +0200 Subject: Server: delete user with the id and not the username --- server/tests/api/checkParams.js | 8 ++++---- server/tests/api/users.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'server/tests/api') diff --git a/server/tests/api/checkParams.js b/server/tests/api/checkParams.js index 128b07c4a..882948fac 100644 --- a/server/tests/api/checkParams.js +++ b/server/tests/api/checkParams.js @@ -610,23 +610,23 @@ describe('Test parameters validator', function () { }) describe('When removing an user', function () { - it('Should fail with an incorrect username', function (done) { + it('Should fail with an incorrect id', function (done) { request(server.url) .delete(path + 'bla-bla') .set('Authorization', 'Bearer ' + server.accessToken) .expect(400, done) }) - it('Should return 404 with a non existing username', function (done) { + it('Should return 404 with a non existing id', function (done) { request(server.url) - .delete(path + 'qzzerg') + .delete(path + '579f982228c99c221d8092b8') .set('Authorization', 'Bearer ' + server.accessToken) .expect(404, done) }) it('Should success with the correct parameters', function (done) { request(server.url) - .delete(path + 'user1') + .delete(path + userId) .set('Authorization', 'Bearer ' + server.accessToken) .expect(204, done) }) diff --git a/server/tests/api/users.js b/server/tests/api/users.js index 6f9eef181..a2557d2ab 100644 --- a/server/tests/api/users.js +++ b/server/tests/api/users.js @@ -235,7 +235,7 @@ describe('Test users', function () { }) it('Should be able to remove this user', function (done) { - usersUtils.removeUser(server.url, accessToken, 'user_1', done) + usersUtils.removeUser(server.url, userId, accessToken, done) }) it('Should not be able to login with this user', function (done) { -- cgit v1.2.3