From 1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sat, 20 Aug 2016 16:59:25 +0200 Subject: Server: make friends urls come from the request instead of the configuration file --- server/tests/utils/pods.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'server/tests/utils/pods.js') 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) { expectedStatus = 204 } + // Which pod makes friends with which pod + const friendsMatrix = { + 'http://localhost:9001': [ + 'http://localhost:9002' + ], + 'http://localhost:9002': [ + 'http://localhost:9003' + ], + 'http://localhost:9003': [ + 'http://localhost:9001' + ], + 'http://localhost:9004': [ + 'http://localhost:9002' + ], + 'http://localhost:9005': [ + 'http://localhost:9001', + 'http://localhost:9004' + ], + 'http://localhost:9006': [ + 'http://localhost:9001', + 'http://localhost:9002', + 'http://localhost:9003' + ] + } const path = '/api/v1/pods/makefriends' // The first pod make friend with the third request(url) - .get(path) + .post(path) .set('Accept', 'application/json') .set('Authorization', 'Bearer ' + accessToken) + .send({ 'urls': friendsMatrix[url] }) .expect(expectedStatus) .end(function (err, res) { if (err) throw err -- cgit v1.2.3