+ await makePutBodyRequest({ url: servers[0].url, path, token: servers[0].accessToken, fields, statusCodeExpected: 204 })
+ })
+ })
+
+ describe('When getting blacklisted video', function () {
+
+ it('Should fail with a non authenticated user', async function () {
+ await getVideo(servers[0].url, servers[0].video.uuid, 401)
+ })
+
+ it('Should fail with another user', async function () {
+ await getVideoWithToken(servers[0].url, userAccessToken2, servers[0].video.uuid, 403)
+ })
+
+ it('Should succeed with the owner authenticated user', async function () {
+ const res = await getVideoWithToken(servers[0].url, userAccessToken1, servers[0].video.uuid, 200)
+ const video: VideoDetails = res.body
+
+ expect(video.blacklisted).to.be.true
+ })
+
+ it('Should succeed with an admin', async function () {
+ const res = await getVideoWithToken(servers[0].url, servers[0].accessToken, servers[0].video.uuid, 200)
+ const video: VideoDetails = res.body
+
+ expect(video.blacklisted).to.be.true
+ })
+ })
+
+ describe('When removing a video in blacklist', function () {
+ it('Should fail with a non authenticated user', async function () {
+ await removeVideoFromBlacklist(servers[0].url, 'fake token', servers[0].video.uuid, 401)
+ })
+
+ it('Should fail with a non admin user', async function () {
+ await removeVideoFromBlacklist(servers[0].url, userAccessToken2, servers[0].video.uuid, 403)
+ })
+
+ it('Should fail with an incorrect id', async function () {
+ await removeVideoFromBlacklist(servers[0].url, servers[0].accessToken, 'hello', 400)