+ await makePostBodyRequest({ url: server.url, path, token: userAccessToken2, fields, statusCodeExpected: 403 })
+ })
+
+ it('Should fail with an invalid reason', async function () {
+ const path = basePath + server.video.uuid + '/blacklist'
+ const fields = { reason: 'a'.repeat(305) }
+
+ await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
+ })
+
+ it('Should succeed with the correct params', async function () {
+ const path = basePath + server.video.uuid + '/blacklist'
+ const fields = { }
+
+ await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields, statusCodeExpected: 204 })
+ })
+ })
+
+ describe('When updating a video in blacklist', function () {
+ const basePath = '/api/v1/videos/'
+
+ it('Should fail with a wrong video', async function () {
+ const wrongPath = '/api/v1/videos/blabla/blacklist'
+ const fields = {}
+ await makePutBodyRequest({ url: server.url, path: wrongPath, token: server.accessToken, fields })
+ })
+
+ it('Should fail with a video not blacklisted', async function () {
+ const path = '/api/v1/videos/' + notBlacklistedVideoId + '/blacklist'
+ const fields = {}
+ await makePutBodyRequest({ url: server.url, path, token: server.accessToken, fields, statusCodeExpected: 404 })
+ })
+
+ it('Should fail with a non authenticated user', async function () {