diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-12-30 12:23:53 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-12-30 12:23:53 +0100 |
commit | efe923bcdaf15b47593ad8583df09a92c715ac6c (patch) | |
tree | 1944856cd35ff8e1845a31ef776d4cf965b4be34 /server/tests/utils/login.js | |
parent | 818f7987eba27c59793e2103168b26129c9404f2 (diff) | |
download | PeerTube-efe923bcdaf15b47593ad8583df09a92c715ac6c.tar.gz PeerTube-efe923bcdaf15b47593ad8583df09a92c715ac6c.tar.zst PeerTube-efe923bcdaf15b47593ad8583df09a92c715ac6c.zip |
Server: split check params tests
Diffstat (limited to 'server/tests/utils/login.js')
-rw-r--r-- | server/tests/utils/login.js | 11 |
1 files changed, 10 insertions, 1 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 | ||
5 | const loginUtils = { | 5 | const 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 | ||
47 | function 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 | ||
48 | module.exports = loginUtils | 57 | module.exports = loginUtils |