X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Futils%2Fvideos.js;h=d1e0b7b14e5ad8ba50efd1e29dc86b5345bb34b8;hb=6f0c39e2de400685b7baf8340b9e132f2659365a;hp=ad0d7407686e9767d0dcc2e3a7075feb68e12e42;hpb=b4c5ac97ffa3e16f837b7e2d72291656eefac812;p=github%2FChocobozzz%2FPeerTube.git 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') const videosUtils = { getVideoCategories, + getVideoLicences, getAllVideosListBy, getVideo, getVideosList, @@ -34,6 +35,17 @@ function getVideoCategories (url, end) { .end(end) } +function getVideoLicences (url, end) { + const path = '/api/v1/videos/licences' + + request(url) + .get(path) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + function getAllVideosListBy (url, end) { const path = '/api/v1/videos' @@ -205,6 +217,7 @@ function uploadVideo (url, accessToken, videoAttributesArg, specialStatus, end) let attributes = { name: 'my super video', category: 5, + licence: 4, description: 'my super description', tags: [ 'tag' ], fixture: 'video_short.webm' @@ -217,6 +230,7 @@ function uploadVideo (url, accessToken, videoAttributesArg, specialStatus, end) .set('Authorization', 'Bearer ' + accessToken) .field('name', attributes.name) .field('category', attributes.category) + .field('licence', attributes.licence) .field('description', attributes.description) for (let i = 0; i < attributes.tags.length; i++) { @@ -250,6 +264,7 @@ function updateVideo (url, accessToken, id, attributes, specialStatus, end) { if (attributes.name) req.field('name', attributes.name) if (attributes.category) req.field('category', attributes.category) + if (attributes.licence) req.field('licence', attributes.licence) if (attributes.description) req.field('description', attributes.description) if (attributes.tags) {