aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-05-01 19:04:29 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-05-01 19:04:29 +0200
commit843aa7ba0312e7180e7bbae147e32ee60e70d9ba (patch)
treedf5533a9dda312877b8b3a6992b81c75044c094e /server/tests/utils
parent3eeeb87fe62fab3e48455f53c8a725b49878b9b3 (diff)
downloadPeerTube-843aa7ba0312e7180e7bbae147e32ee60e70d9ba.tar.gz
PeerTube-843aa7ba0312e7180e7bbae147e32ee60e70d9ba.tar.zst
PeerTube-843aa7ba0312e7180e7bbae147e32ee60e70d9ba.zip
Server: add tests for video blacklists
Diffstat (limited to 'server/tests/utils')
-rw-r--r--server/tests/utils/video-abuses.js4
-rw-r--r--server/tests/utils/video-blacklists.js29
2 files changed, 31 insertions, 2 deletions
diff --git a/server/tests/utils/video-abuses.js b/server/tests/utils/video-abuses.js
index 596c824b3..c4dd87990 100644
--- a/server/tests/utils/video-abuses.js
+++ b/server/tests/utils/video-abuses.js
@@ -2,7 +2,7 @@
2 2
3const request = require('supertest') 3const request = require('supertest')
4 4
5const videosUtils = { 5const videosAbuseUtils = {
6 getVideoAbusesList, 6 getVideoAbusesList,
7 getVideoAbusesListPagination, 7 getVideoAbusesListPagination,
8 getVideoAbusesListSort, 8 getVideoAbusesListSort,
@@ -70,4 +70,4 @@ function getVideoAbusesListSort (url, token, sort, end) {
70 70
71// --------------------------------------------------------------------------- 71// ---------------------------------------------------------------------------
72 72
73module.exports = videosUtils 73module.exports = videosAbuseUtils
diff --git a/server/tests/utils/video-blacklists.js b/server/tests/utils/video-blacklists.js
new file mode 100644
index 000000000..0a58dd631
--- /dev/null
+++ b/server/tests/utils/video-blacklists.js
@@ -0,0 +1,29 @@
1'use strict'
2
3const request = require('supertest')
4
5const videosBlacklistsUtils = {
6 addVideoToBlacklist
7}
8
9// ---------------------- Export functions --------------------
10
11function 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
29module.exports = videosBlacklistsUtils