From 6f0c39e2de400685b7baf8340b9e132f2659365a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 27 Mar 2017 20:53:11 +0200 Subject: Server: add licence video attribute --- server/tests/utils/videos.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'server/tests/utils') 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) { -- cgit v1.2.3