+ licence: 1,
+ language: 6,
+ nsfw: false,
+ description: 'my super description',
+ tags: [ 'tag1', 'tag2' ]
+ }
+ const attach = {
+ 'videofile': pathUtils.join(__dirname, '..', 'fixtures', 'video_short.webm')
+ }
+ requestsUtils.makePostUploadRequest(server.url, path, server.accessToken, data, attach, done)
+ })
+
+ it('Should fail without a licence', function (done) {
+ const data = {
+ name: 'my super name',
+ category: 5,
+ language: 6,
+ nsfw: false,
+ description: 'my super description',
+ tags: [ 'tag1', 'tag2' ]
+ }
+ const attach = {
+ 'videofile': pathUtils.join(__dirname, '..', 'fixtures', 'video_short.webm')
+ }
+ requestsUtils.makePostUploadRequest(server.url, path, server.accessToken, data, attach, done)
+ })
+
+ it('Should fail with a bad licence', function (done) {
+ const data = {
+ name: 'my super name',
+ category: 5,
+ licence: 125,
+ language: 6,
+ nsfw: false,
+ description: 'my super description',
+ tags: [ 'tag1', 'tag2' ]
+ }
+ const attach = {
+ 'videofile': pathUtils.join(__dirname, '..', 'fixtures', 'video_short.webm')
+ }
+ requestsUtils.makePostUploadRequest(server.url, path, server.accessToken, data, attach, done)
+ })
+
+ it('Should fail with a bad language', function (done) {
+ const data = {
+ name: 'my super name',
+ category: 5,
+ licence: 4,
+ language: 563,
+ nsfw: false,
+ description: 'my super description',
+ tags: [ 'tag1', 'tag2' ]
+ }
+ const attach = {
+ 'videofile': pathUtils.join(__dirname, '..', 'fixtures', 'video_short.webm')
+ }
+ requestsUtils.makePostUploadRequest(server.url, path, server.accessToken, data, attach, done)
+ })
+
+ it('Should fail without nsfw attribute', function (done) {
+ const data = {
+ name: 'my super name',
+ category: 5,
+ licence: 4,
+ language: 6,
+ description: 'my super description',
+ tags: [ 'tag1', 'tag2' ]
+ }
+ const attach = {
+ 'videofile': pathUtils.join(__dirname, '..', 'fixtures', 'video_short.webm')
+ }
+ requestsUtils.makePostUploadRequest(server.url, path, server.accessToken, data, attach, done)
+ })
+
+ it('Should fail with a bad nsfw attribue', function (done) {
+ const data = {
+ name: 'my super name',
+ category: 5,
+ licence: 4,
+ language: 6,
+ nsfw: 2,