From 1f3e9feca2caf68024168b0ea9ed39d8438fa235 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 30 Nov 2017 09:21:11 +0100 Subject: Better view counter --- server/tests/utils/videos.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'server/tests/utils') 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) { .expect(expectedStatus) } +function viewVideo (url: string, id: number | string, expectedStatus = 204) { + const path = '/api/v1/videos/' + id + '/views' + + return request(url) + .post(path) + .set('Accept', 'application/json') + .expect(expectedStatus) +} + function getVideoWithToken (url: string, token: string, id: number | string, expectedStatus = 200) { const path = '/api/v1/videos/' + id @@ -313,5 +322,6 @@ export { uploadVideo, updateVideo, rateVideo, + viewVideo, parseTorrentVideo } -- cgit v1.2.3