diff options
Diffstat (limited to 'test/api')
-rw-r--r-- | test/api/friendsAdvanced.js | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/test/api/friendsAdvanced.js b/test/api/friendsAdvanced.js index 5d3891923..1103d3a97 100644 --- a/test/api/friendsAdvanced.js +++ b/test/api/friendsAdvanced.js | |||
@@ -83,45 +83,41 @@ | |||
83 | 83 | ||
84 | // Expulse pod 4 from pod 1 and 2 | 84 | // Expulse pod 4 from pod 1 and 2 |
85 | uploadVideo(1, function () { | 85 | uploadVideo(1, function () { |
86 | setTimeout(function () { | 86 | uploadVideo(2, function () { |
87 | uploadVideo(1, function () { | 87 | setTimeout(function () { |
88 | setTimeout(function () { | 88 | uploadVideo(1, function () { |
89 | uploadVideo(2, function () { | 89 | uploadVideo(2, function () { |
90 | setTimeout(function () { | 90 | setTimeout(function () { |
91 | uploadVideo(2, function () { | 91 | // Rerun server 4 |
92 | setTimeout(function () { | 92 | utils.runServer(4, function (app, url) { |
93 | // Rerun server 4 | 93 | apps[3] = app |
94 | utils.runServer(4, function (app, url) { | 94 | getFriendsList(4, function (err, res) { |
95 | apps[3] = app | 95 | if (err) throw err |
96 | getFriendsList(4, function (err, res) { | 96 | // Pod 4 didn't know pod 1 and 2 removed it |
97 | expect(res.body.length).to.equal(3) | ||
98 | |||
99 | // Pod 6 ask pod 1, 2 and 3 | ||
100 | makeFriend(6, function () { | ||
101 | getFriendsList(6, function (err, res) { | ||
97 | if (err) throw err | 102 | if (err) throw err |
98 | // Pod 4 didn't know pod 1 and 2 removed it | 103 | |
99 | expect(res.body.length).to.equal(3) | 104 | // Pod 4 should not be our friend |
100 | 105 | var result = res.body | |
101 | // Pod 6 ask pod 1, 2 and 3 | 106 | expect(result.length).to.equal(3) |
102 | makeFriend(6, function () { | 107 | for (var pod of result) { |
103 | getFriendsList(6, function (err, res) { | 108 | expect(pod.url).not.equal(urls[3]) |
104 | if (err) throw err | 109 | } |
105 | 110 | ||
106 | // Pod 4 should not be our friend | 111 | done() |
107 | var result = res.body | ||
108 | expect(result.length).to.equal(3) | ||
109 | for (var pod of result) { | ||
110 | expect(pod.url).not.equal(urls[3]) | ||
111 | } | ||
112 | |||
113 | done() | ||
114 | }) | ||
115 | }) | ||
116 | }) | 112 | }) |
117 | }) | 113 | }) |
118 | }, 15000) | 114 | }) |
119 | }) | 115 | }) |
120 | }, 15000) | 116 | }, 15000) |
121 | }) | 117 | }) |
122 | }, 15000) | 118 | }) |
123 | }) | 119 | }, 11000) |
124 | }, 15000) | 120 | }) |
125 | }) | 121 | }) |
126 | }) | 122 | }) |
127 | }) | 123 | }) |