diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-03-27 20:53:11 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-03-27 20:53:11 +0200 |
commit | 6f0c39e2de400685b7baf8340b9e132f2659365a (patch) | |
tree | b036c6ebf65ff4cb7f5649fc48a0b7201370bddd /server/tests/utils | |
parent | 28974889281523eec5b00dd5596c67d99c5167e5 (diff) | |
download | PeerTube-6f0c39e2de400685b7baf8340b9e132f2659365a.tar.gz PeerTube-6f0c39e2de400685b7baf8340b9e132f2659365a.tar.zst PeerTube-6f0c39e2de400685b7baf8340b9e132f2659365a.zip |
Server: add licence video attribute
Diffstat (limited to 'server/tests/utils')
-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) { |