diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-25 17:19:46 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-25 17:19:46 +0200 |
commit | e636eb88101a51399057c86477af6677f5614d48 (patch) | |
tree | ba56f0da932613c8013a2c52905ded1987cd6d6d /server/tests/utils/request-schedulers.js | |
parent | 4f133041819409a72cf70fa2fa6c4df14c6de4fd (diff) | |
download | PeerTube-e636eb88101a51399057c86477af6677f5614d48.tar.gz PeerTube-e636eb88101a51399057c86477af6677f5614d48.tar.zst PeerTube-e636eb88101a51399057c86477af6677f5614d48.zip |
Requests -> RequestSchedulers
Diffstat (limited to 'server/tests/utils/request-schedulers.js')
-rw-r--r-- | server/tests/utils/request-schedulers.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/server/tests/utils/request-schedulers.js b/server/tests/utils/request-schedulers.js new file mode 100644 index 000000000..16835ce47 --- /dev/null +++ b/server/tests/utils/request-schedulers.js | |||
@@ -0,0 +1,25 @@ | |||
1 | 'use strict' | ||
2 | |||
3 | const request = require('supertest') | ||
4 | |||
5 | const requestsStatsUtils = { | ||
6 | getRequestsStats | ||
7 | } | ||
8 | |||
9 | // ---------------------- Export functions -------------------- | ||
10 | |||
11 | function getRequestsStats (server, accessToken, callback) { | ||
12 | const path = '/api/v1/requests/stats' | ||
13 | |||
14 | request(server.url) | ||
15 | .get(path) | ||
16 | .set('Accept', 'application/json') | ||
17 | .set('Authorization', 'Bearer ' + accessToken) | ||
18 | .expect(200) | ||
19 | .expect('Content-Type', /json/) | ||
20 | .end(callback) | ||
21 | } | ||
22 | |||
23 | // --------------------------------------------------------------------------- | ||
24 | |||
25 | module.exports = requestsStatsUtils | ||