aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/utils.js')
-rw-r--r--server/tests/api/utils.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/tests/api/utils.js b/server/tests/api/utils.js
index 05142085f..ea0982e81 100644
--- a/server/tests/api/utils.js
+++ b/server/tests/api/utils.js
@@ -9,6 +9,7 @@ const request = require('supertest')
9const testUtils = { 9const testUtils = {
10 flushTests: flushTests, 10 flushTests: flushTests,
11 getFriendsList: getFriendsList, 11 getFriendsList: getFriendsList,
12 getVideo: getVideo,
12 getVideosList: getVideosList, 13 getVideosList: getVideosList,
13 makeFriends: makeFriends, 14 makeFriends: makeFriends,
14 quitFriends: quitFriends, 15 quitFriends: quitFriends,
@@ -36,6 +37,17 @@ function getFriendsList (url, end) {
36 .end(end) 37 .end(end)
37} 38}
38 39
40function getVideo (url, id, end) {
41 const path = '/api/v1/videos/' + id
42
43 request(url)
44 .get(path)
45 .set('Accept', 'application/json')
46 .expect(200)
47 .expect('Content-Type', /json/)
48 .end(end)
49}
50
39function getVideosList (url, end) { 51function getVideosList (url, end) {
40 const path = '/api/v1/videos' 52 const path = '/api/v1/videos'
41 53