aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-12-30 12:23:53 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-12-30 12:23:53 +0100
commitefe923bcdaf15b47593ad8583df09a92c715ac6c (patch)
tree1944856cd35ff8e1845a31ef776d4cf965b4be34 /server/tests/utils
parent818f7987eba27c59793e2103168b26129c9404f2 (diff)
downloadPeerTube-efe923bcdaf15b47593ad8583df09a92c715ac6c.tar.gz
PeerTube-efe923bcdaf15b47593ad8583df09a92c715ac6c.tar.zst
PeerTube-efe923bcdaf15b47593ad8583df09a92c715ac6c.zip
Server: split check params tests
Diffstat (limited to 'server/tests/utils')
-rw-r--r--server/tests/utils/login.js11
-rw-r--r--server/tests/utils/servers.js2
2 files changed, 11 insertions, 2 deletions
diff --git a/server/tests/utils/login.js b/server/tests/utils/login.js
index 465564e14..c984c0baf 100644
--- a/server/tests/utils/login.js
+++ b/server/tests/utils/login.js
@@ -4,7 +4,8 @@ const request = require('supertest')
4 4
5const loginUtils = { 5const loginUtils = {
6 login, 6 login,
7 loginAndGetAccessToken 7 loginAndGetAccessToken,
8 getUserAccessToken
8} 9}
9 10
10// ---------------------- Export functions -------------------- 11// ---------------------- Export functions --------------------
@@ -43,6 +44,14 @@ function loginAndGetAccessToken (server, callback) {
43 }) 44 })
44} 45}
45 46
47function getUserAccessToken (server, user, callback) {
48 login(server.url, server.client, user, 200, function (err, res) {
49 if (err) return callback(err)
50
51 return callback(null, res.body.access_token)
52 })
53}
54
46// --------------------------------------------------------------------------- 55// ---------------------------------------------------------------------------
47 56
48module.exports = loginUtils 57module.exports = loginUtils
diff --git a/server/tests/utils/servers.js b/server/tests/utils/servers.js
index e7c756499..1946ef49a 100644
--- a/server/tests/utils/servers.js
+++ b/server/tests/utils/servers.js
@@ -34,7 +34,7 @@ function flushAndRunMultipleServers (totalServers, serversRun) {
34 runServer(j, function (app, url) { 34 runServer(j, function (app, url) {
35 anotherServerDone(j, app, url) 35 anotherServerDone(j, app, url)
36 }) 36 })
37 }, 1000 * j) 37 }, 1000 * (j - 1))
38 } 38 }
39 }) 39 })
40} 40}