diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-20 16:59:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-20 17:11:38 +0200 |
commit | 1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1 (patch) | |
tree | 1a2601d63152da4906335c6116ba5f1e8992af33 /server/tests/utils/pods.js | |
parent | e861452fb26553177ad4e32bfb18b4fd8a5b1816 (diff) | |
download | PeerTube-1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1.tar.gz PeerTube-1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1.tar.zst PeerTube-1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1.zip |
Server: make friends urls come from the request instead of the
configuration file
Diffstat (limited to 'server/tests/utils/pods.js')
-rw-r--r-- | server/tests/utils/pods.js | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/server/tests/utils/pods.js b/server/tests/utils/pods.js index 366492110..9a9148856 100644 --- a/server/tests/utils/pods.js +++ b/server/tests/utils/pods.js | |||
@@ -27,13 +27,38 @@ function makeFriends (url, accessToken, expectedStatus, end) { | |||
27 | expectedStatus = 204 | 27 | expectedStatus = 204 |
28 | } | 28 | } |
29 | 29 | ||
30 | // Which pod makes friends with which pod | ||
31 | const friendsMatrix = { | ||
32 | 'http://localhost:9001': [ | ||
33 | 'http://localhost:9002' | ||
34 | ], | ||
35 | 'http://localhost:9002': [ | ||
36 | 'http://localhost:9003' | ||
37 | ], | ||
38 | 'http://localhost:9003': [ | ||
39 | 'http://localhost:9001' | ||
40 | ], | ||
41 | 'http://localhost:9004': [ | ||
42 | 'http://localhost:9002' | ||
43 | ], | ||
44 | 'http://localhost:9005': [ | ||
45 | 'http://localhost:9001', | ||
46 | 'http://localhost:9004' | ||
47 | ], | ||
48 | 'http://localhost:9006': [ | ||
49 | 'http://localhost:9001', | ||
50 | 'http://localhost:9002', | ||
51 | 'http://localhost:9003' | ||
52 | ] | ||
53 | } | ||
30 | const path = '/api/v1/pods/makefriends' | 54 | const path = '/api/v1/pods/makefriends' |
31 | 55 | ||
32 | // The first pod make friend with the third | 56 | // The first pod make friend with the third |
33 | request(url) | 57 | request(url) |
34 | .get(path) | 58 | .post(path) |
35 | .set('Accept', 'application/json') | 59 | .set('Accept', 'application/json') |
36 | .set('Authorization', 'Bearer ' + accessToken) | 60 | .set('Authorization', 'Bearer ' + accessToken) |
61 | .send({ 'urls': friendsMatrix[url] }) | ||
37 | .expect(expectedStatus) | 62 | .expect(expectedStatus) |
38 | .end(function (err, res) { | 63 | .end(function (err, res) { |
39 | if (err) throw err | 64 | if (err) throw err |