]>
Commit | Line | Data |
---|---|---|
843aa7ba C |
1 | 'use strict' |
2 | ||
3 | const request = require('supertest') | |
4 | ||
5 | const videosBlacklistsUtils = { | |
6 | addVideoToBlacklist | |
7 | } | |
8 | ||
9 | // ---------------------- Export functions -------------------- | |
10 | ||
11 | function addVideoToBlacklist (url, token, videoId, specialStatus, end) { | |
12 | if (!end) { | |
13 | end = specialStatus | |
14 | specialStatus = 204 | |
15 | } | |
16 | ||
17 | const path = '/api/v1/videos/' + videoId + '/blacklist' | |
18 | ||
19 | request(url) | |
20 | .post(path) | |
21 | .set('Accept', 'application/json') | |
22 | .set('Authorization', 'Bearer ' + token) | |
23 | .expect(specialStatus) | |
24 | .end(end) | |
25 | } | |
26 | ||
27 | // --------------------------------------------------------------------------- | |
28 | ||
29 | module.exports = videosBlacklistsUtils |