diff options
Diffstat (limited to 'server/tests/api/utils.js')
-rw-r--r-- | server/tests/api/utils.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server/tests/api/utils.js b/server/tests/api/utils.js index e0068eada..7c8698a0a 100644 --- a/server/tests/api/utils.js +++ b/server/tests/api/utils.js | |||
@@ -10,6 +10,7 @@ const request = require('supertest') | |||
10 | const testUtils = { | 10 | const testUtils = { |
11 | dateIsValid: dateIsValid, | 11 | dateIsValid: dateIsValid, |
12 | flushTests: flushTests, | 12 | flushTests: flushTests, |
13 | getAllVideosListBy: getAllVideosListBy, | ||
13 | getFriendsList: getFriendsList, | 14 | getFriendsList: getFriendsList, |
14 | getVideo: getVideo, | 15 | getVideo: getVideo, |
15 | getVideosList: getVideosList, | 16 | getVideosList: getVideosList, |
@@ -45,6 +46,20 @@ function flushTests (callback) { | |||
45 | exec('npm run clean:server:test', callback) | 46 | exec('npm run clean:server:test', callback) |
46 | } | 47 | } |
47 | 48 | ||
49 | function getAllVideosListBy (url, end) { | ||
50 | const path = '/api/v1/videos' | ||
51 | |||
52 | request(url) | ||
53 | .get(path) | ||
54 | .query({ sort: 'createdDate' }) | ||
55 | .query({ start: 0 }) | ||
56 | .query({ count: 10000 }) | ||
57 | .set('Accept', 'application/json') | ||
58 | .expect(200) | ||
59 | .expect('Content-Type', /json/) | ||
60 | .end(end) | ||
61 | } | ||
62 | |||
48 | function getFriendsList (url, end) { | 63 | function getFriendsList (url, end) { |
49 | const path = '/api/v1/pods/' | 64 | const path = '/api/v1/pods/' |
50 | 65 | ||