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 ad0d74076..d1e0b7b14 100644 --- a/server/tests/utils/videos.js +++ b/server/tests/utils/videos.js | |||
@@ -6,6 +6,7 @@ const request = require('supertest') | |||
6 | 6 | ||
7 | const videosUtils = { | 7 | const videosUtils = { |
8 | getVideoCategories, | 8 | getVideoCategories, |
9 | getVideoLicences, | ||
9 | getAllVideosListBy, | 10 | getAllVideosListBy, |
10 | getVideo, | 11 | getVideo, |
11 | getVideosList, | 12 | getVideosList, |
@@ -34,6 +35,17 @@ function getVideoCategories (url, end) { | |||
34 | .end(end) | 35 | .end(end) |
35 | } | 36 | } |
36 | 37 | ||
38 | function getVideoLicences (url, end) { | ||
39 | const path = '/api/v1/videos/licences' | ||
40 | |||
41 | request(url) | ||
42 | .get(path) | ||
43 | .set('Accept', 'application/json') | ||
44 | .expect(200) | ||
45 | .expect('Content-Type', /json/) | ||
46 | .end(end) | ||
47 | } | ||
48 | |||
37 | function getAllVideosListBy (url, end) { | 49 | function getAllVideosListBy (url, end) { |
38 | const path = '/api/v1/videos' | 50 | const path = '/api/v1/videos' |
39 | 51 | ||
@@ -205,6 +217,7 @@ function uploadVideo (url, accessToken, videoAttributesArg, specialStatus, end) | |||
205 | let attributes = { | 217 | let attributes = { |
206 | name: 'my super video', | 218 | name: 'my super video', |
207 | category: 5, | 219 | category: 5, |
220 | licence: 4, | ||
208 | description: 'my super description', | 221 | description: 'my super description', |
209 | tags: [ 'tag' ], | 222 | tags: [ 'tag' ], |
210 | fixture: 'video_short.webm' | 223 | fixture: 'video_short.webm' |
@@ -217,6 +230,7 @@ function uploadVideo (url, accessToken, videoAttributesArg, specialStatus, end) | |||
217 | .set('Authorization', 'Bearer ' + accessToken) | 230 | .set('Authorization', 'Bearer ' + accessToken) |
218 | .field('name', attributes.name) | 231 | .field('name', attributes.name) |
219 | .field('category', attributes.category) | 232 | .field('category', attributes.category) |
233 | .field('licence', attributes.licence) | ||
220 | .field('description', attributes.description) | 234 | .field('description', attributes.description) |
221 | 235 | ||
222 | for (let i = 0; i < attributes.tags.length; i++) { | 236 | for (let i = 0; i < attributes.tags.length; i++) { |
@@ -250,6 +264,7 @@ function updateVideo (url, accessToken, id, attributes, specialStatus, end) { | |||
250 | 264 | ||
251 | if (attributes.name) req.field('name', attributes.name) | 265 | if (attributes.name) req.field('name', attributes.name) |
252 | if (attributes.category) req.field('category', attributes.category) | 266 | if (attributes.category) req.field('category', attributes.category) |
267 | if (attributes.licence) req.field('licence', attributes.licence) | ||
253 | if (attributes.description) req.field('description', attributes.description) | 268 | if (attributes.description) req.field('description', attributes.description) |
254 | 269 | ||
255 | if (attributes.tags) { | 270 | if (attributes.tags) { |