diff options
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 | ||