+ it('Should fail with an incorrect thumbnail file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ 'thumbnailfile': join(__dirname, '..', '..', 'fixtures', 'avatar.png')
+ }
+
+ await makeUploadRequest({
+ url: server.url,
+ method: 'PUT',
+ path: path + videoId,
+ token: server.accessToken,
+ fields,
+ attaches
+ })
+ })
+
+ it('Should fail with a big thumbnail file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ 'thumbnailfile': join(__dirname, '..', '..', 'fixtures', 'avatar-big.png')
+ }
+
+ await makeUploadRequest({
+ url: server.url,
+ method: 'PUT',
+ path: path + videoId,
+ token: server.accessToken,
+ fields,
+ attaches
+ })
+ })
+
+ it('Should fail with an incorrect preview file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ 'previewfile': join(__dirname, '..', '..', 'fixtures', 'avatar.png')
+ }
+
+ await makeUploadRequest({
+ url: server.url,
+ method: 'PUT',
+ path: path + videoId,
+ token: server.accessToken,
+ fields,
+ attaches
+ })
+ })
+
+ it('Should fail with a big preview file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ 'previewfile': join(__dirname, '..', '..', 'fixtures', 'avatar-big.png')
+ }
+
+ await makeUploadRequest({
+ url: server.url,
+ method: 'PUT',
+ path: path + videoId,
+ token: server.accessToken,
+ fields,
+ attaches
+ })
+ })
+
+ it('Should fail with a video of another user without the appropriate right', async function () {
+ const fields = baseCorrectParams
+
+ await makePutBodyRequest({ url: server.url, path: path + videoId, token: userAccessToken, fields, statusCodeExpected: 403 })
+ })