diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-07-05 21:36:01 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-07-05 21:36:01 +0200 |
commit | 6666aad4599a78f98f39409ec0d45391da7bd2d0 (patch) | |
tree | 2935754fb62522b085ffb41af2592b7a9a56e5ac /server/tests/api/utils.js | |
parent | 0890478c5c259bb787dc7f847e38be081df7c8e1 (diff) | |
download | PeerTube-6666aad4599a78f98f39409ec0d45391da7bd2d0.tar.gz PeerTube-6666aad4599a78f98f39409ec0d45391da7bd2d0.tar.zst PeerTube-6666aad4599a78f98f39409ec0d45391da7bd2d0.zip |
Fix requests ordering between pods
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 | ||