it('Should fail with nothing', async function () {
const fields = {}
const attaches = {}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail without name', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail with a long name', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail without a category', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail with a bad category', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail without a licence', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail with a bad licence', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail with a bad language', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail without nsfw attribute', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail with a bad nsfw attribue', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail without description', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail with a long description', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail with too many tags', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail with a tag length too low', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail with a tag length too big', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail without an input file', async function () {
tags: [ 'tag1', 'tag2' ]
}
const attaches = {}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail without an incorrect input file', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_short_fake.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail with a too big duration', async function () {
const attaches = {
'videofile': join(__dirname, '..', 'fixtures', 'video_too_long.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
+ await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should succeed with the correct parameters', async function () {
'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
}
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches, statusCodeExpected: 204 })
+ await makePostUploadRequest({
+ url: server.url,
+ path: path + '/upload',
+ token: server.accessToken,
+ fields,
+ attaches,
+ statusCodeExpected: 204
+ })
attaches.videofile = join(__dirname, '..', 'fixtures', 'video_short.mp4')
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches, statusCodeExpected: 204 })
+ await makePostUploadRequest({
+ url: server.url,
+ path: path + '/upload',
+ token: server.accessToken,
+ fields,
+ attaches,
+ statusCodeExpected: 204
+ })
attaches.videofile = join(__dirname, '..', 'fixtures', 'video_short.ogv')
- await makePostUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches, statusCodeExpected: 204 })
+ await makePostUploadRequest({
+ url: server.url,
+ path: path + '/upload',
+ token: server.accessToken,
+ fields,
+ attaches,
+ statusCodeExpected: 204
+ })
})
})