+ const path = basePath + servers[0].video + '/blacklist'
+ const fields = {}
+ await makePostBodyRequest({ url: servers[0].url, path, token: userAccessToken2, fields, statusCodeExpected: 403 })
+ })
+
+ it('Should fail with an invalid reason', async function () {
+ const path = basePath + servers[0].video.uuid + '/blacklist'
+ const fields = { reason: 'a'.repeat(305) }
+
+ await makePostBodyRequest({ url: servers[0].url, path, token: servers[0].accessToken, fields })
+ })
+
+ it('Should fail to unfederate a remote video', async function () {
+ const path = basePath + remoteVideoUUID + '/blacklist'
+ const fields = { unfederate: true }
+
+ await makePostBodyRequest({ url: servers[0].url, path, token: servers[0].accessToken, fields, statusCodeExpected: 409 })
+ })
+
+ it('Should succeed with the correct params', async function () {
+ const path = basePath + servers[0].video.uuid + '/blacklist'
+ const fields = { }
+
+ await makePostBodyRequest({ url: servers[0].url, path, token: servers[0].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'