diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-10 10:02:18 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-10 10:18:16 +0200 |
commit | 35bf0c83c80f59ca79f4b84fac8700f17adeb22d (patch) | |
tree | a9b2106096d6ba04d7219051b17fd32cfbe6a885 /server/tests | |
parent | 769d332177a5b02d5c2ffc134687d3b4ed65bae9 (diff) | |
download | PeerTube-35bf0c83c80f59ca79f4b84fac8700f17adeb22d.tar.gz PeerTube-35bf0c83c80f59ca79f4b84fac8700f17adeb22d.tar.zst PeerTube-35bf0c83c80f59ca79f4b84fac8700f17adeb22d.zip |
Video blacklist refractoring
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/check-params/video-blacklist.ts | 12 | ||||
-rw-r--r-- | server/tests/utils/video-blacklist.ts | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts index 80e6f8011..eb16b3af0 100644 --- a/server/tests/api/check-params/video-blacklist.ts +++ b/server/tests/api/check-params/video-blacklist.ts | |||
@@ -81,10 +81,10 @@ describe('Test video blacklist API validators', function () { | |||
81 | }) | 81 | }) |
82 | 82 | ||
83 | describe('When removing a video in blacklist', function () { | 83 | describe('When removing a video in blacklist', function () { |
84 | const basePath = '/api/v1/blacklist/' | 84 | const basePath = '/api/v1/videos/' |
85 | 85 | ||
86 | it('Should fail with a non authenticated user', async function () { | 86 | it('Should fail with a non authenticated user', async function () { |
87 | const path = basePath + server.video.id | 87 | const path = basePath + server.video.id + '/blacklist' |
88 | 88 | ||
89 | await request(server.url) | 89 | await request(server.url) |
90 | .delete(path) | 90 | .delete(path) |
@@ -94,7 +94,7 @@ describe('Test video blacklist API validators', function () { | |||
94 | }) | 94 | }) |
95 | 95 | ||
96 | it('Should fail with a non admin user', async function () { | 96 | it('Should fail with a non admin user', async function () { |
97 | const path = basePath + server.video.id | 97 | const path = basePath + server.video.id + '/blacklist' |
98 | 98 | ||
99 | await request(server.url) | 99 | await request(server.url) |
100 | .delete(path) | 100 | .delete(path) |
@@ -104,7 +104,7 @@ describe('Test video blacklist API validators', function () { | |||
104 | }) | 104 | }) |
105 | 105 | ||
106 | it('Should fail with an incorrect id', async function () { | 106 | it('Should fail with an incorrect id', async function () { |
107 | const path = basePath + 'foobar' | 107 | const path = basePath + 'foobar/blacklist' |
108 | 108 | ||
109 | await request(server.url) | 109 | await request(server.url) |
110 | .delete(path) | 110 | .delete(path) |
@@ -115,7 +115,7 @@ describe('Test video blacklist API validators', function () { | |||
115 | 115 | ||
116 | it('Should fail with a not blacklisted video', async function () { | 116 | it('Should fail with a not blacklisted video', async function () { |
117 | // The video was not added to the blacklist so it should fail | 117 | // The video was not added to the blacklist so it should fail |
118 | const path = basePath + server.video.id | 118 | const path = basePath + server.video.id + '/blacklist' |
119 | 119 | ||
120 | await request(server.url) | 120 | await request(server.url) |
121 | .delete(path) | 121 | .delete(path) |
@@ -126,7 +126,7 @@ describe('Test video blacklist API validators', function () { | |||
126 | }) | 126 | }) |
127 | 127 | ||
128 | describe('When listing videos in blacklist', function () { | 128 | describe('When listing videos in blacklist', function () { |
129 | const basePath = '/api/v1/blacklist/' | 129 | const basePath = '/api/v1/videos/blacklist/' |
130 | 130 | ||
131 | it('Should fail with a non authenticated user', async function () { | 131 | it('Should fail with a non authenticated user', async function () { |
132 | const path = basePath | 132 | const path = basePath |
diff --git a/server/tests/utils/video-blacklist.ts b/server/tests/utils/video-blacklist.ts index 5729d13d8..3a499f46a 100644 --- a/server/tests/utils/video-blacklist.ts +++ b/server/tests/utils/video-blacklist.ts | |||
@@ -11,7 +11,7 @@ function addVideoToBlacklist (url: string, token: string, videoId: number, speci | |||
11 | } | 11 | } |
12 | 12 | ||
13 | function removeVideoFromBlacklist (url: string, token: string, videoId: number, specialStatus = 204) { | 13 | function removeVideoFromBlacklist (url: string, token: string, videoId: number, specialStatus = 204) { |
14 | const path = '/api/v1/blacklist/' + videoId | 14 | const path = '/api/v1/videos/' + videoId + '/blacklist' |
15 | 15 | ||
16 | return request(url) | 16 | return request(url) |
17 | .delete(path) | 17 | .delete(path) |
@@ -21,7 +21,7 @@ function removeVideoFromBlacklist (url: string, token: string, videoId: number, | |||
21 | } | 21 | } |
22 | 22 | ||
23 | function getBlacklistedVideosList (url: string, token: string, specialStatus = 200) { | 23 | function getBlacklistedVideosList (url: string, token: string, specialStatus = 200) { |
24 | const path = '/api/v1/blacklist/' | 24 | const path = '/api/v1/videos/blacklist/' |
25 | 25 | ||
26 | return request(url) | 26 | return request(url) |
27 | .get(path) | 27 | .get(path) |
@@ -33,7 +33,7 @@ function getBlacklistedVideosList (url: string, token: string, specialStatus = 2 | |||
33 | } | 33 | } |
34 | 34 | ||
35 | function getSortedBlacklistedVideosList (url: string, token: string, sort: string, specialStatus = 200) { | 35 | function getSortedBlacklistedVideosList (url: string, token: string, sort: string, specialStatus = 200) { |
36 | const path = '/api/v1/blacklist/' | 36 | const path = '/api/v1/videos/blacklist/' |
37 | 37 | ||
38 | return request(url) | 38 | return request(url) |
39 | .get(path) | 39 | .get(path) |