]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/utils/users.js
Server: Add NSFW in user profile
[github/Chocobozzz/PeerTube.git] / server / tests / utils / users.js
index 7817160b94e9b50c39230fc5d70f171aca244f1d..8138074d014f7553ee60fc9e3cc28076a5e4b35a 100644 (file)
@@ -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)
 }