From 3092476e64d09b449b4ad4f5198024afec1b22ca Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Apr 2017 12:13:37 +0200 Subject: Server: add video language 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 3c7d99eec..f0eeec497 100644 --- a/server/tests/utils/videos.js +++ b/server/tests/utils/videos.js @@ -7,6 +7,7 @@ const request = require('supertest') const videosUtils = { getVideoCategories, getVideoLicences, + getVideoLanguages, getAllVideosListBy, getVideo, getVideosList, @@ -46,6 +47,17 @@ function getVideoLicences (url, end) { .end(end) } +function getVideoLanguages (url, end) { + const path = '/api/v1/videos/languages' + + 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' @@ -218,6 +230,7 @@ function uploadVideo (url, accessToken, videoAttributesArg, specialStatus, end) name: 'my super video', category: 5, licence: 4, + language: 3, nsfw: true, description: 'my super description', tags: [ 'tag' ], @@ -232,6 +245,7 @@ function uploadVideo (url, accessToken, videoAttributesArg, specialStatus, end) .field('name', attributes.name) .field('category', attributes.category) .field('licence', attributes.licence) + .field('language', attributes.language) .field('nsfw', attributes.nsfw) .field('description', attributes.description) @@ -267,6 +281,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.language) req.field('language', attributes.language) if (attributes.nsfw) req.field('nsfw', attributes.nsfw) if (attributes.description) req.field('description', attributes.description) -- cgit v1.2.3