]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/utils/pods.js
Server: make friends urls come from the request instead of the
[github/Chocobozzz/PeerTube.git] / server / tests / utils / pods.js
index 3664921108cfb889bc3f27e6b35c06fac8e013a7..9a9148856bd4c0850854c6d3a417d0d046f5af4e 100644 (file)
@@ -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