await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
- it('Should fail without a category', async function () {
- const fields = getCompleteVideoUploadAttributes()
- delete fields.category
-
- const attaches = getVideoUploadAttaches
- await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
- })
-
it('Should fail with a bad category', async function () {
const fields = getCompleteVideoUploadAttributes()
fields.category = 125
await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
- it('Should fail without a licence', async function () {
- const fields = getCompleteVideoUploadAttributes()
- delete fields.licence
-
- const attaches = getVideoUploadAttaches()
- await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
- })
-
it('Should fail with a bad licence', async function () {
const fields = getCompleteVideoUploadAttributes()
fields.licence = 125
await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
- it('Should fail without description', async function () {
- const fields = getCompleteVideoUploadAttributes()
- delete fields.description
-
- const attaches = getVideoUploadAttaches()
- await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
- })
-
it('Should fail with a long description', async function () {
const fields = getCompleteVideoUploadAttributes()
fields.description = 'my super description which is very very very very very very very very very very very very long'.repeat(35)
await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
- it('Should fail with a too big duration', async function () {
- const fields = getCompleteVideoUploadAttributes()
- const attaches = {
- 'videofile': join(__dirname, '..', 'fixtures', 'video_too_long.webm')
- }
- await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
- })
-
it('Should succeed with the correct parameters', async function () {
this.timeout(10000)