- it('Should fail with an incorrect id', async function () {
- const path = basePath + 'foobar'
+ it('Should succeed with the correct params', async function () {
+ const path = basePath + servers[0].video.uuid + '/blacklist'
+ const fields = { reason: 'hello' }
+
+ 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