]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/utils/pods.js
3 const request
= require('supertest')
6 getFriendsList: getFriendsList
,
7 makeFriends: makeFriends
,
8 quitFriends: quitFriends
11 // ---------------------- Export functions --------------------
13 function getFriendsList (url
, end
) {
14 const path
= '/api/v1/pods/'
18 .set('Accept', 'application/json')
20 .expect('Content-Type', /json/)
24 function makeFriends (url
, accessToken
, expectedStatus
, end
) {
30 const path
= '/api/v1/pods/makefriends'
32 // The first pod make friend with the third
35 .set('Accept', 'application/json')
36 .set('Authorization', 'Bearer ' + accessToken
)
37 .expect(expectedStatus
)
38 .end(function (err
, res
) {
41 // Wait for the request between pods
46 function quitFriends (url
, accessToken
, expectedStatus
, end
) {
52 const path
= '/api/v1/pods/quitfriends'
54 // The first pod make friend with the third
57 .set('Accept', 'application/json')
58 .set('Authorization', 'Bearer ' + accessToken
)
59 .expect(expectedStatus
)
60 .end(function (err
, res
) {
63 // Wait for the request between pods
68 // ---------------------------------------------------------------------------
70 module
.exports
= podsUtils