diff options
Diffstat (limited to 'server/tests/utils/videos.js')
-rw-r--r-- | server/tests/utils/videos.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server/tests/utils/videos.js b/server/tests/utils/videos.js index 3c7d99eec..f0eeec497 100644 --- a/server/tests/utils/videos.js +++ b/server/tests/utils/videos.js | |||
@@ -7,6 +7,7 @@ const request = require('supertest') | |||
7 | const videosUtils = { | 7 | const videosUtils = { |
8 | getVideoCategories, | 8 | getVideoCategories, |
9 | getVideoLicences, | 9 | getVideoLicences, |
10 | getVideoLanguages, | ||
10 | getAllVideosListBy, | 11 | getAllVideosListBy, |
11 | getVideo, | 12 | getVideo, |
12 | getVideosList, | 13 | getVideosList, |
@@ -46,6 +47,17 @@ function getVideoLicences (url, end) { | |||
46 | .end(end) | 47 | .end(end) |
47 | } | 48 | } |
48 | 49 | ||
50 | function getVideoLanguages (url, end) { | ||
51 | const path = '/api/v1/videos/languages' | ||
52 | |||
53 | request(url) | ||
54 | .get(path) | ||
55 | .set('Accept', 'application/json') | ||
56 | .expect(200) | ||
57 | .expect('Content-Type', /json/) | ||
58 | .end(end) | ||
59 | } | ||
60 | |||
49 | function getAllVideosListBy (url, end) { | 61 | function getAllVideosListBy (url, end) { |
50 | const path = '/api/v1/videos' | 62 | const path = '/api/v1/videos' |
51 | 63 | ||
@@ -218,6 +230,7 @@ function uploadVideo (url, accessToken, videoAttributesArg, specialStatus, end) | |||
218 | name: 'my super video', | 230 | name: 'my super video', |
219 | category: 5, | 231 | category: 5, |
220 | licence: 4, | 232 | licence: 4, |
233 | language: 3, | ||
221 | nsfw: true, | 234 | nsfw: true, |
222 | description: 'my super description', | 235 | description: 'my super description', |
223 | tags: [ 'tag' ], | 236 | tags: [ 'tag' ], |
@@ -232,6 +245,7 @@ function uploadVideo (url, accessToken, videoAttributesArg, specialStatus, end) | |||
232 | .field('name', attributes.name) | 245 | .field('name', attributes.name) |
233 | .field('category', attributes.category) | 246 | .field('category', attributes.category) |
234 | .field('licence', attributes.licence) | 247 | .field('licence', attributes.licence) |
248 | .field('language', attributes.language) | ||
235 | .field('nsfw', attributes.nsfw) | 249 | .field('nsfw', attributes.nsfw) |
236 | .field('description', attributes.description) | 250 | .field('description', attributes.description) |
237 | 251 | ||
@@ -267,6 +281,7 @@ function updateVideo (url, accessToken, id, attributes, specialStatus, end) { | |||
267 | if (attributes.name) req.field('name', attributes.name) | 281 | if (attributes.name) req.field('name', attributes.name) |
268 | if (attributes.category) req.field('category', attributes.category) | 282 | if (attributes.category) req.field('category', attributes.category) |
269 | if (attributes.licence) req.field('licence', attributes.licence) | 283 | if (attributes.licence) req.field('licence', attributes.licence) |
284 | if (attributes.language) req.field('language', attributes.language) | ||
270 | if (attributes.nsfw) req.field('nsfw', attributes.nsfw) | 285 | if (attributes.nsfw) req.field('nsfw', attributes.nsfw) |
271 | if (attributes.description) req.field('description', attributes.description) | 286 | if (attributes.description) req.field('description', attributes.description) |
272 | 287 | ||