From 1d49e1e27d63db1dfc9a7fd28c9902f488831a89 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 3 Apr 2017 21:24:36 +0200 Subject: Server: Add NSFW in user profile --- server/tests/utils/users.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'server/tests/utils') diff --git a/server/tests/utils/users.js b/server/tests/utils/users.js index 7817160b9..8138074d0 100644 --- a/server/tests/utils/users.js +++ b/server/tests/utils/users.js @@ -101,14 +101,18 @@ function removeUser (url, userId, accessToken, expectedStatus, end) { .end(end) } -function updateUser (url, userId, accessToken, newPassword, end) { +function updateUser (url, userId, accessToken, newPassword, displayNSFW, end) { const path = '/api/v1/users/' + userId + const toSend = {} + if (newPassword !== undefined && newPassword !== null) toSend.password = newPassword + if (displayNSFW !== undefined && displayNSFW !== null) toSend.displayNSFW = displayNSFW + request(url) .put(path) .set('Accept', 'application/json') .set('Authorization', 'Bearer ' + accessToken) - .send({ password: newPassword }) + .send(toSend) .expect(204) .end(end) } -- cgit v1.2.3