aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/utils/videos.ts')
-rw-r--r--server/tests/utils/videos.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/tests/utils/videos.ts b/server/tests/utils/videos.ts
index dababe924..73a9f1a0a 100644
--- a/server/tests/utils/videos.ts
+++ b/server/tests/utils/videos.ts
@@ -55,6 +55,15 @@ function getVideo (url: string, id: number | string, expectedStatus = 200) {
55 .expect(expectedStatus) 55 .expect(expectedStatus)
56} 56}
57 57
58function viewVideo (url: string, id: number | string, expectedStatus = 204) {
59 const path = '/api/v1/videos/' + id + '/views'
60
61 return request(url)
62 .post(path)
63 .set('Accept', 'application/json')
64 .expect(expectedStatus)
65}
66
58function getVideoWithToken (url: string, token: string, id: number | string, expectedStatus = 200) { 67function getVideoWithToken (url: string, token: string, id: number | string, expectedStatus = 200) {
59 const path = '/api/v1/videos/' + id 68 const path = '/api/v1/videos/' + id
60 69
@@ -313,5 +322,6 @@ export {
313 uploadVideo, 322 uploadVideo,
314 updateVideo, 323 updateVideo,
315 rateVideo, 324 rateVideo,
325 viewVideo,
316 parseTorrentVideo 326 parseTorrentVideo
317} 327}