From 6666aad4599a78f98f39409ec0d45391da7bd2d0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 5 Jul 2016 21:36:01 +0200 Subject: Fix requests ordering between pods --- server/tests/api/utils.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'server/tests/api') 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') const testUtils = { dateIsValid: dateIsValid, flushTests: flushTests, + getAllVideosListBy: getAllVideosListBy, getFriendsList: getFriendsList, getVideo: getVideo, getVideosList: getVideosList, @@ -45,6 +46,20 @@ function flushTests (callback) { exec('npm run clean:server:test', callback) } +function getAllVideosListBy (url, end) { + const path = '/api/v1/videos' + + request(url) + .get(path) + .query({ sort: 'createdDate' }) + .query({ start: 0 }) + .query({ count: 10000 }) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + function getFriendsList (url, end) { const path = '/api/v1/pods/' -- cgit v1.2.3