diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-30 09:21:11 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-30 09:21:11 +0100 |
commit | 1f3e9feca2caf68024168b0ea9ed39d8438fa235 (patch) | |
tree | b77b02d11796cf435496fd22b85c430a7ed2479f /server/tests/utils/videos.ts | |
parent | 86d13ec2aa94ec10810ddf9c8b33314bd4968791 (diff) | |
download | PeerTube-1f3e9feca2caf68024168b0ea9ed39d8438fa235.tar.gz PeerTube-1f3e9feca2caf68024168b0ea9ed39d8438fa235.tar.zst PeerTube-1f3e9feca2caf68024168b0ea9ed39d8438fa235.zip |
Better view counter
Diffstat (limited to 'server/tests/utils/videos.ts')
-rw-r--r-- | server/tests/utils/videos.ts | 10 |
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 | ||
58 | function 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 | |||
58 | function getVideoWithToken (url: string, token: string, id: number | string, expectedStatus = 200) { | 67 | function 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 | } |