diff options
Diffstat (limited to 'server/tests/utils/video-blacklists.ts')
-rw-r--r-- | server/tests/utils/video-blacklists.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/server/tests/utils/video-blacklists.ts b/server/tests/utils/video-blacklists.ts new file mode 100644 index 000000000..6812d3ad4 --- /dev/null +++ b/server/tests/utils/video-blacklists.ts | |||
@@ -0,0 +1,17 @@ | |||
1 | import * as request from 'supertest' | ||
2 | |||
3 | function addVideoToBlacklist (url: string, token: string, videoId: number, specialStatus = 204) { | ||
4 | const path = '/api/v1/videos/' + videoId + '/blacklist' | ||
5 | |||
6 | return request(url) | ||
7 | .post(path) | ||
8 | .set('Accept', 'application/json') | ||
9 | .set('Authorization', 'Bearer ' + token) | ||
10 | .expect(specialStatus) | ||
11 | } | ||
12 | |||
13 | // --------------------------------------------------------------------------- | ||
14 | |||
15 | export { | ||
16 | addVideoToBlacklist | ||
17 | } | ||