aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/users
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-19 11:01:34 +0200
committerChocobozzz <me@florianbigard.com>2018-04-19 11:01:34 +0200
commit0883b3245bf0deb9106c4041e9afbd3521b79280 (patch)
treefcb73005e0b31a3b763ee5d22d5fc39c2da89907 /server/tests/utils/users
parent04ed10b21e8e1339514faae0bb690e4d97c23b0a (diff)
downloadPeerTube-0883b3245bf0deb9106c4041e9afbd3521b79280.tar.gz
PeerTube-0883b3245bf0deb9106c4041e9afbd3521b79280.tar.zst
PeerTube-0883b3245bf0deb9106c4041e9afbd3521b79280.zip
Add ability to choose what policy we have for NSFW videos
There is a global instance setting and a per user setting
Diffstat (limited to 'server/tests/utils/users')
-rw-r--r--server/tests/utils/users/users.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/tests/utils/users/users.ts b/server/tests/utils/users/users.ts
index daf731a14..fc6b26c50 100644
--- a/server/tests/utils/users/users.ts
+++ b/server/tests/utils/users/users.ts
@@ -3,6 +3,7 @@ import * as request from 'supertest'
3import { makePostBodyRequest, makeUploadRequest, makePutBodyRequest } from '../' 3import { makePostBodyRequest, makeUploadRequest, makePutBodyRequest } from '../'
4 4
5import { UserRole } from '../../../../shared/index' 5import { UserRole } from '../../../../shared/index'
6import { NSFWPolicyType } from '../../../../shared/models/videos/nsfw-policy.type'
6 7
7function createUser ( 8function createUser (
8 url: string, 9 url: string,
@@ -128,7 +129,7 @@ function updateMyUser (options: {
128 url: string 129 url: string
129 accessToken: string, 130 accessToken: string,
130 newPassword?: string, 131 newPassword?: string,
131 displayNSFW?: boolean, 132 nsfwPolicy?: NSFWPolicyType,
132 email?: string, 133 email?: string,
133 autoPlayVideo?: boolean 134 autoPlayVideo?: boolean
134 description?: string 135 description?: string
@@ -137,7 +138,7 @@ function updateMyUser (options: {
137 138
138 const toSend = {} 139 const toSend = {}
139 if (options.newPassword !== undefined && options.newPassword !== null) toSend['password'] = options.newPassword 140 if (options.newPassword !== undefined && options.newPassword !== null) toSend['password'] = options.newPassword
140 if (options.displayNSFW !== undefined && options.displayNSFW !== null) toSend['displayNSFW'] = options.displayNSFW 141 if (options.nsfwPolicy !== undefined && options.nsfwPolicy !== null) toSend['nsfwPolicy'] = options.nsfwPolicy
141 if (options.autoPlayVideo !== undefined && options.autoPlayVideo !== null) toSend['autoPlayVideo'] = options.autoPlayVideo 142 if (options.autoPlayVideo !== undefined && options.autoPlayVideo !== null) toSend['autoPlayVideo'] = options.autoPlayVideo
142 if (options.email !== undefined && options.email !== null) toSend['email'] = options.email 143 if (options.email !== undefined && options.email !== null) toSend['email'] = options.email
143 if (options.description !== undefined && options.description !== null) toSend['description'] = options.description 144 if (options.description !== undefined && options.description !== null) toSend['description'] = options.description