+ const attach = {
+ 'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
+ }
+ makePostRequest(path, server.accessToken, data, attach, done)
+ })
+
+ it('Should fail with too many tags', function (done) {
+ const data = {
+ name: 'my super name',
+ description: 'my super description',
+ tags: [ 'tag1', 'tag2', 'tag3', 'tag4' ]
+ }
+ const attach = {
+ 'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
+ }
+ makePostRequest(path, server.accessToken, data, attach, done)
+ })
+
+ it('Should fail with not enough tags', function (done) {
+ const data = {
+ name: 'my super name',
+ description: 'my super description',
+ tags: [ ]
+ }
+ const attach = {
+ 'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
+ }
+ makePostRequest(path, server.accessToken, data, attach, done)
+ })
+
+ it('Should fail with a tag length too low', function (done) {
+ const data = {
+ name: 'my super name',
+ description: 'my super description',
+ tags: [ 'tag1', 't' ]
+ }
+ const attach = {
+ 'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
+ }
+ makePostRequest(path, server.accessToken, data, attach, done)
+ })
+
+ it('Should fail with a tag length too big', function (done) {
+ const data = {
+ name: 'my super name',
+ description: 'my super description',
+ tags: [ 'mysupertagtoolong', 'tag1' ]
+ }
+ const attach = {
+ 'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
+ }
+ makePostRequest(path, server.accessToken, data, attach, done)
+ })
+
+ it('Should fail with malformed tags', function (done) {
+ const data = {
+ name: 'my super name',
+ description: 'my super description',
+ tags: [ 'my tag' ]
+ }
+ const attach = {
+ 'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
+ }
+ makePostRequest(path, server.accessToken, data, attach, done)
+ })
+
+ it('Should fail without an input file', function (done) {
+ const data = {
+ name: 'my super name',
+ description: 'my super description',
+ tags: [ 'tag1', 'tag2' ]
+ }