diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-05 17:19:08 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-05 17:19:08 +0200 |
commit | 99a64bfed25e45547df3045cf249bc895e6f220b (patch) | |
tree | 0e8150155d616ee25eac41196bdb6cf7413b376c /server/tests/api/utils.js | |
parent | 6606150c49f587bc7eb0ecec4263ce7fbb18bf15 (diff) | |
download | PeerTube-99a64bfed25e45547df3045cf249bc895e6f220b.tar.gz PeerTube-99a64bfed25e45547df3045cf249bc895e6f220b.tar.zst PeerTube-99a64bfed25e45547df3045cf249bc895e6f220b.zip |
Server: allow user to get its informations (/users/me)
Diffstat (limited to 'server/tests/api/utils.js')
-rw-r--r-- | server/tests/api/utils.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/tests/api/utils.js b/server/tests/api/utils.js index f34b81e4a..0dc309328 100644 --- a/server/tests/api/utils.js +++ b/server/tests/api/utils.js | |||
@@ -14,6 +14,7 @@ const testUtils = { | |||
14 | getAllVideosListBy: getAllVideosListBy, | 14 | getAllVideosListBy: getAllVideosListBy, |
15 | getClient: getClient, | 15 | getClient: getClient, |
16 | getFriendsList: getFriendsList, | 16 | getFriendsList: getFriendsList, |
17 | getUserInformation: getUserInformation, | ||
17 | getUsersList: getUsersList, | 18 | getUsersList: getUsersList, |
18 | getVideo: getVideo, | 19 | getVideo: getVideo, |
19 | getVideosList: getVideosList, | 20 | getVideosList: getVideosList, |
@@ -93,6 +94,18 @@ function getClient (url, end) { | |||
93 | .end(end) | 94 | .end(end) |
94 | } | 95 | } |
95 | 96 | ||
97 | function getUserInformation (url, accessToken, end) { | ||
98 | const path = '/api/v1/users/me' | ||
99 | |||
100 | request(url) | ||
101 | .get(path) | ||
102 | .set('Accept', 'application/json') | ||
103 | .set('Authorization', 'Bearer ' + accessToken) | ||
104 | .expect(200) | ||
105 | .expect('Content-Type', /json/) | ||
106 | .end(end) | ||
107 | } | ||
108 | |||
96 | function getUsersList (url, end) { | 109 | function getUsersList (url, end) { |
97 | const path = '/api/v1/users' | 110 | const path = '/api/v1/users' |
98 | 111 | ||