aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-04-03 21:24:36 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-04-03 21:24:36 +0200
commit1d49e1e27d63db1dfc9a7fd28c9902f488831a89 (patch)
treece3353ad691876c55ce8fcfdd70bfa2b9112b39a /server/tests/utils
parent31b59b477459d4f26ed8ef089a0e5553fb6a332b (diff)
downloadPeerTube-1d49e1e27d63db1dfc9a7fd28c9902f488831a89.tar.gz
PeerTube-1d49e1e27d63db1dfc9a7fd28c9902f488831a89.tar.zst
PeerTube-1d49e1e27d63db1dfc9a7fd28c9902f488831a89.zip
Server: Add NSFW in user profile
Diffstat (limited to 'server/tests/utils')
-rw-r--r--server/tests/utils/users.js8
1 files changed, 6 insertions, 2 deletions
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) {
101 .end(end) 101 .end(end)
102} 102}
103 103
104function updateUser (url, userId, accessToken, newPassword, end) { 104function updateUser (url, userId, accessToken, newPassword, displayNSFW, end) {
105 const path = '/api/v1/users/' + userId 105 const path = '/api/v1/users/' + userId
106 106
107 const toSend = {}
108 if (newPassword !== undefined && newPassword !== null) toSend.password = newPassword
109 if (displayNSFW !== undefined && displayNSFW !== null) toSend.displayNSFW = displayNSFW
110
107 request(url) 111 request(url)
108 .put(path) 112 .put(path)
109 .set('Accept', 'application/json') 113 .set('Accept', 'application/json')
110 .set('Authorization', 'Bearer ' + accessToken) 114 .set('Authorization', 'Bearer ' + accessToken)
111 .send({ password: newPassword }) 115 .send(toSend)
112 .expect(204) 116 .expect(204)
113 .end(end) 117 .end(end)
114} 118}