diff options
Diffstat (limited to 'server/tests/utils/users.js')
-rw-r--r-- | server/tests/utils/users.js | 13 |
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') | |||
5 | const usersUtils = { | 5 | const 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 | ||
51 | function 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 | |||
50 | function getUsersList (url, end) { | 63 | function getUsersList (url, end) { |
51 | const path = '/api/v1/users' | 64 | const path = '/api/v1/users' |
52 | 65 | ||