]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/users.js
Server: Add NSFW in user profile
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / users.js
index b04f9f4a6fa6cdefab7b9406fffb30af0b2db95a..4a176e6c28db0541eeba79d8d063452024d757be 100644 (file)
@@ -270,6 +270,14 @@ describe('Test users API validators', function () {
       requestsUtils.makePutBodyRequest(server.url, path + userId, userAccessToken, data, done)
     })
 
+    it('Should fail with an invalid display NSFW attribute', function (done) {
+      const data = {
+        displayNSFW: -1
+      }
+
+      requestsUtils.makePutBodyRequest(server.url, path + userId, userAccessToken, data, done)
+    })
+
     it('Should fail with an non authenticated user', function (done) {
       const data = {
         password: 'my super password'
@@ -280,7 +288,8 @@ describe('Test users API validators', function () {
 
     it('Should succeed with the correct params', function (done) {
       const data = {
-        password: 'my super password'
+        password: 'my super password',
+        displayNSFW: true
       }
 
       requestsUtils.makePutBodyRequest(server.url, path + userId, userAccessToken, data, done, 204)