aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/users.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-03-08 21:35:43 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-03-08 21:35:43 +0100
commitd38b82810638b9f664c9016fac2684454c273a77 (patch)
tree9465c367e5033675309efca4d66790c6fdd5230d /server/tests/utils/users.js
parent8f9064432122cba0f518a24ac4378357dadec589 (diff)
downloadPeerTube-d38b82810638b9f664c9016fac2684454c273a77.tar.gz
PeerTube-d38b82810638b9f664c9016fac2684454c273a77.tar.zst
PeerTube-d38b82810638b9f664c9016fac2684454c273a77.zip
Add like/dislike system for videos
Diffstat (limited to 'server/tests/utils/users.js')
-rw-r--r--server/tests/utils/users.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/server/tests/utils/users.js b/server/tests/utils/users.js
index a2c010f64..7817160b9 100644
--- a/server/tests/utils/users.js
+++ b/server/tests/utils/users.js
@@ -5,6 +5,7 @@ const request = require('supertest')
5const usersUtils = { 5const usersUtils = {
6 createUser, 6 createUser,
7 getUserInformation, 7 getUserInformation,
8 getUserVideoRating,
8 getUsersList, 9 getUsersList,
9 getUsersListPaginationAndSort, 10 getUsersListPaginationAndSort,
10 removeUser, 11 removeUser,
@@ -47,6 +48,18 @@ function getUserInformation (url, accessToken, end) {
47 .end(end) 48 .end(end)
48} 49}
49 50
51function getUserVideoRating (url, accessToken, videoId, end) {
52 const path = '/api/v1/users/me/videos/' + videoId + '/rating'
53
54 request(url)
55 .get(path)
56 .set('Accept', 'application/json')
57 .set('Authorization', 'Bearer ' + accessToken)
58 .expect(200)
59 .expect('Content-Type', /json/)
60 .end(end)
61}
62
50function getUsersList (url, end) { 63function getUsersList (url, end) {
51 const path = '/api/v1/users' 64 const path = '/api/v1/users'
52 65