aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-25 16:15:39 +0200
committerChocobozzz <me@florianbigard.com>2018-04-25 16:16:21 +0200
commitcc918ac3f45e32f031cce7b6e0473e5c2c34b8ae (patch)
tree034c0ce9cda37d572fe1c0c34eff750681e18574 /server/tests/utils
parentd3e91a5f72ac9c986cdb67d7d6c85bb4819e680c (diff)
downloadPeerTube-cc918ac3f45e32f031cce7b6e0473e5c2c34b8ae.tar.gz
PeerTube-cc918ac3f45e32f031cce7b6e0473e5c2c34b8ae.tar.zst
PeerTube-cc918ac3f45e32f031cce7b6e0473e5c2c34b8ae.zip
Update video-channel routes (again)
Use /video-channels now, it's more simple for clients
Diffstat (limited to 'server/tests/utils')
-rw-r--r--server/tests/utils/videos/video-channels.ts14
-rw-r--r--server/tests/utils/videos/videos.ts3
2 files changed, 7 insertions, 10 deletions
diff --git a/server/tests/utils/videos/video-channels.ts b/server/tests/utils/videos/video-channels.ts
index 0b4fa89b7..978e21b19 100644
--- a/server/tests/utils/videos/video-channels.ts
+++ b/server/tests/utils/videos/video-channels.ts
@@ -34,11 +34,10 @@ function getAccountVideoChannelsList (url: string, accountId: number | string, s
34function addVideoChannel ( 34function addVideoChannel (
35 url: string, 35 url: string,
36 token: string, 36 token: string,
37 accountId: number | string,
38 videoChannelAttributesArg: VideoChannelAttributes, 37 videoChannelAttributesArg: VideoChannelAttributes,
39 expectedStatus = 200 38 expectedStatus = 200
40) { 39) {
41 const path = '/api/v1/accounts/' + accountId + '/video-channels/' 40 const path = '/api/v1/video-channels/'
42 41
43 // Default attributes 42 // Default attributes
44 let attributes = { 43 let attributes = {
@@ -59,13 +58,12 @@ function addVideoChannel (
59function updateVideoChannel ( 58function updateVideoChannel (
60 url: string, 59 url: string,
61 token: string, 60 token: string,
62 accountId: number | string,
63 channelId: number | string, 61 channelId: number | string,
64 attributes: VideoChannelAttributes, 62 attributes: VideoChannelAttributes,
65 expectedStatus = 204 63 expectedStatus = 204
66) { 64) {
67 const body = {} 65 const body = {}
68 const path = '/api/v1/accounts/' + accountId + '/video-channels/' + channelId 66 const path = '/api/v1/video-channels/' + channelId
69 67
70 if (attributes.name) body['name'] = attributes.name 68 if (attributes.name) body['name'] = attributes.name
71 if (attributes.description) body['description'] = attributes.description 69 if (attributes.description) body['description'] = attributes.description
@@ -79,8 +77,8 @@ function updateVideoChannel (
79 .expect(expectedStatus) 77 .expect(expectedStatus)
80} 78}
81 79
82function deleteVideoChannel (url: string, token: string, accountId: number | string, channelId: number | string, expectedStatus = 204) { 80function deleteVideoChannel (url: string, token: string, channelId: number | string, expectedStatus = 204) {
83 const path = '/api/v1/accounts/' + accountId + '/video-channels/' + channelId 81 const path = '/api/v1/video-channels/' + channelId
84 82
85 return request(url) 83 return request(url)
86 .delete(path) 84 .delete(path)
@@ -89,8 +87,8 @@ function deleteVideoChannel (url: string, token: string, accountId: number | str
89 .expect(expectedStatus) 87 .expect(expectedStatus)
90} 88}
91 89
92function getVideoChannel (url: string, accountId: number | string, channelId: number | string) { 90function getVideoChannel (url: string, channelId: number | string) {
93 const path = '/api/v1/accounts/' + accountId + '/video-channels/' + channelId 91 const path = '/api/v1/video-channels/' + channelId
94 92
95 return request(url) 93 return request(url)
96 .get(path) 94 .get(path)
diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts
index d1d8c07df..870dfd21f 100644
--- a/server/tests/utils/videos/videos.ts
+++ b/server/tests/utils/videos/videos.ts
@@ -186,13 +186,12 @@ function getAccountVideos (url: string, accessToken: string, accountId: number |
186function getVideoChannelVideos ( 186function getVideoChannelVideos (
187 url: string, 187 url: string,
188 accessToken: string, 188 accessToken: string,
189 accountId: number | string,
190 videoChannelId: number | string, 189 videoChannelId: number | string,
191 start: number, 190 start: number,
192 count: number, 191 count: number,
193 sort?: string 192 sort?: string
194) { 193) {
195 const path = '/api/v1/accounts/' + accountId + '/video-channels/' + videoChannelId + '/videos' 194 const path = '/api/v1/video-channels/' + videoChannelId + '/videos'
196 195
197 return makeGetRequest({ 196 return makeGetRequest({
198 url, 197 url,