]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/utils/videos.js
Type models
[github/Chocobozzz/PeerTube.git] / server / tests / utils / videos.js
index 3c7d99eec61de373a083d52a2afd34a7954e31f8..f0eeec497d32b7adecd429ba378b9a9029ce4767 100644 (file)
@@ -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)