diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-16 22:31:45 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-16 22:31:45 +0200 |
commit | 5c39adb7313e0696aabb4b71196ab7b0b378c359 (patch) | |
tree | ac44b67890509338b984f8cbf11660dc77cdd0fd /server/tests/utils/users.js | |
parent | 089ff2f2046fdbaf9531726eea1f8c6726ebf0c0 (diff) | |
download | PeerTube-5c39adb7313e0696aabb4b71196ab7b0b378c359.tar.gz PeerTube-5c39adb7313e0696aabb4b71196ab7b0b378c359.tar.zst PeerTube-5c39adb7313e0696aabb4b71196ab7b0b378c359.zip |
Server: add user list sort/pagination
Diffstat (limited to 'server/tests/utils/users.js')
-rw-r--r-- | server/tests/utils/users.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server/tests/utils/users.js b/server/tests/utils/users.js index 3b560e409..0cf4e4adb 100644 --- a/server/tests/utils/users.js +++ b/server/tests/utils/users.js | |||
@@ -6,6 +6,7 @@ const usersUtils = { | |||
6 | createUser: createUser, | 6 | createUser: createUser, |
7 | getUserInformation: getUserInformation, | 7 | getUserInformation: getUserInformation, |
8 | getUsersList: getUsersList, | 8 | getUsersList: getUsersList, |
9 | getUsersListPaginationAndSort: getUsersListPaginationAndSort, | ||
9 | removeUser: removeUser, | 10 | removeUser: removeUser, |
10 | updateUser: updateUser | 11 | updateUser: updateUser |
11 | } | 12 | } |
@@ -52,6 +53,20 @@ function getUsersList (url, end) { | |||
52 | .end(end) | 53 | .end(end) |
53 | } | 54 | } |
54 | 55 | ||
56 | function getUsersListPaginationAndSort (url, start, count, sort, end) { | ||
57 | const path = '/api/v1/users' | ||
58 | |||
59 | request(url) | ||
60 | .get(path) | ||
61 | .query({ start: start }) | ||
62 | .query({ count: count }) | ||
63 | .query({ sort: sort }) | ||
64 | .set('Accept', 'application/json') | ||
65 | .expect(200) | ||
66 | .expect('Content-Type', /json/) | ||
67 | .end(end) | ||
68 | } | ||
69 | |||
55 | function removeUser (url, userId, accessToken, expectedStatus, end) { | 70 | function removeUser (url, userId, accessToken, expectedStatus, end) { |
56 | if (!end) { | 71 | if (!end) { |
57 | end = expectedStatus | 72 | end = expectedStatus |