aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/api/friendsAdvanced.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/api/friendsAdvanced.js')
-rw-r--r--test/api/friendsAdvanced.js68
1 files changed, 38 insertions, 30 deletions
diff --git a/test/api/friendsAdvanced.js b/test/api/friendsAdvanced.js
index ccddac4dc..680d90aee 100644
--- a/test/api/friendsAdvanced.js
+++ b/test/api/friendsAdvanced.js
@@ -103,9 +103,9 @@
103 }) 103 })
104 104
105 it('Should make friends with the pods 1, 2, 3', function (done) { 105 it('Should make friends with the pods 1, 2, 3', function (done) {
106 this.timeout(100000) 106 this.timeout(150000)
107 107
108 // Pods 1, 2, 3 and 4 become friends 108 // Pods 1, 2, 3 and 4 become friends (yes this is beautiful)
109 makeFriend(2, function () { 109 makeFriend(2, function () {
110 makeFriend(1, function () { 110 makeFriend(1, function () {
111 makeFriend(4, function () { 111 makeFriend(4, function () {
@@ -114,37 +114,45 @@
114 114
115 // Expulse pod 4 from pod 1 and 2 115 // Expulse pod 4 from pod 1 and 2
116 uploadVideo(1, function () { 116 uploadVideo(1, function () {
117 uploadVideo(1, function () { 117 setTimeout(function () {
118 uploadVideo(2, function () { 118 uploadVideo(1, function () {
119 uploadVideo(2, function () { 119 setTimeout(function () {
120 // Rerun server 4 120 uploadVideo(2, function () {
121 utils.runServer(4, function (app, url) { 121 setTimeout(function () {
122 apps[3] = app 122 uploadVideo(2, function () {
123 getFriendsList(4, function (err, res) { 123 setTimeout(function () {
124 if (err) throw err 124 // Rerun server 4
125 // Pod 4 didn't know pod 1 and 2 removed it 125 utils.runServer(4, function (app, url) {
126 expect(res.body.length).to.equal(3) 126 apps[3] = app
127 127 getFriendsList(4, function (err, res) {
128 // Pod 6 ask pod 1, 2 and 3 128 if (err) throw err
129 makeFriend(6, function () { 129 // Pod 4 didn't know pod 1 and 2 removed it
130 getFriendsList(6, function (err, res) { 130 expect(res.body.length).to.equal(3)
131 if (err) throw err 131
132 132 // Pod 6 ask pod 1, 2 and 3
133 // Pod 4 should not be our friend 133 makeFriend(6, function () {
134 var result = res.body 134 getFriendsList(6, function (err, res) {
135 expect(result.length).to.equal(3) 135 if (err) throw err
136 for (var pod of result) { 136
137 expect(pod.url).not.equal(urls[3]) 137 // Pod 4 should not be our friend
138 } 138 var result = res.body
139 139 expect(result.length).to.equal(3)
140 done() 140 for (var pod of result) {
141 }) 141 expect(pod.url).not.equal(urls[3])
142 }
143
144 done()
145 })
146 })
147 })
148 })
149 }, 11000)
142 }) 150 })
143 }) 151 }, 11000)
144 }) 152 })
145 }) 153 }, 11000)
146 }) 154 })
147 }) 155 }, 11000)
148 }) 156 })
149 }) 157 })
150 }) 158 })