aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/multiplePods.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/multiplePods.js')
-rw-r--r--server/tests/api/multiplePods.js28
1 files changed, 24 insertions, 4 deletions
diff --git a/server/tests/api/multiplePods.js b/server/tests/api/multiplePods.js
index dac6dd410..40326c260 100644
--- a/server/tests/api/multiplePods.js
+++ b/server/tests/api/multiplePods.js
@@ -75,7 +75,11 @@ describe('Test multiple pods', function () {
75 75
76 async.series([ 76 async.series([
77 function (next) { 77 function (next) {
78 utils.uploadVideo(servers[0].url, servers[0].accessToken, 'my super name for pod 1', 'my super description for pod 1', 'video_short1.webm', next) 78 const name = 'my super name for pod 1'
79 const description = 'my super description for pod 1'
80 const tags = [ 'tag1p1', 'tag2p1' ]
81 const file = 'video_short1.webm'
82 utils.uploadVideo(servers[0].url, servers[0].accessToken, name, description, tags, file, next)
79 }, 83 },
80 function (next) { 84 function (next) {
81 setTimeout(next, 11000) 85 setTimeout(next, 11000)
@@ -99,6 +103,7 @@ describe('Test multiple pods', function () {
99 expect(video.podUrl).to.equal('localhost:9001') 103 expect(video.podUrl).to.equal('localhost:9001')
100 expect(video.magnetUri).to.exist 104 expect(video.magnetUri).to.exist
101 expect(video.duration).to.equal(10) 105 expect(video.duration).to.equal(10)
106 expect(video.tags).to.deep.equal([ 'tag1p1', 'tag2p1' ])
102 expect(utils.dateIsValid(video.createdDate)).to.be.true 107 expect(utils.dateIsValid(video.createdDate)).to.be.true
103 108
104 if (server.url !== 'http://localhost:9001') { 109 if (server.url !== 'http://localhost:9001') {
@@ -131,7 +136,11 @@ describe('Test multiple pods', function () {
131 136
132 async.series([ 137 async.series([
133 function (next) { 138 function (next) {
134 utils.uploadVideo(servers[1].url, servers[1].accessToken, 'my super name for pod 2', 'my super description for pod 2', 'video_short2.webm', next) 139 const name = 'my super name for pod 2'
140 const description = 'my super description for pod 2'
141 const tags = [ 'tag1p2', 'tag2p2', 'tag3p2' ]
142 const file = 'video_short2.webm'
143 utils.uploadVideo(servers[1].url, servers[1].accessToken, name, description, tags, file, next)
135 }, 144 },
136 function (next) { 145 function (next) {
137 setTimeout(next, 11000) 146 setTimeout(next, 11000)
@@ -155,6 +164,7 @@ describe('Test multiple pods', function () {
155 expect(video.podUrl).to.equal('localhost:9002') 164 expect(video.podUrl).to.equal('localhost:9002')
156 expect(video.magnetUri).to.exist 165 expect(video.magnetUri).to.exist
157 expect(video.duration).to.equal(5) 166 expect(video.duration).to.equal(5)
167 expect(video.tags).to.deep.equal([ 'tag1p2', 'tag2p2', 'tag3p2' ])
158 expect(utils.dateIsValid(video.createdDate)).to.be.true 168 expect(utils.dateIsValid(video.createdDate)).to.be.true
159 169
160 if (server.url !== 'http://localhost:9002') { 170 if (server.url !== 'http://localhost:9002') {
@@ -187,10 +197,18 @@ describe('Test multiple pods', function () {
187 197
188 async.series([ 198 async.series([
189 function (next) { 199 function (next) {
190 utils.uploadVideo(servers[2].url, servers[2].accessToken, 'my super name for pod 3', 'my super description for pod 3', 'video_short3.webm', next) 200 const name = 'my super name for pod 3'
201 const description = 'my super description for pod 3'
202 const tags = [ 'tag1p3' ]
203 const file = 'video_short3.webm'
204 utils.uploadVideo(servers[2].url, servers[2].accessToken, name, description, tags, file, next)
191 }, 205 },
192 function (next) { 206 function (next) {
193 utils.uploadVideo(servers[2].url, servers[2].accessToken, 'my super name for pod 3-2', 'my super description for pod 3-2', 'video_short.webm', next) 207 const name = 'my super name for pod 3-2'
208 const description = 'my super description for pod 3-2'
209 const tags = [ 'tag2p3', 'tag3p3', 'tag4p3' ]
210 const file = 'video_short.webm'
211 utils.uploadVideo(servers[2].url, servers[2].accessToken, name, description, tags, file, next)
194 }, 212 },
195 function (next) { 213 function (next) {
196 setTimeout(next, 22000) 214 setTimeout(next, 22000)
@@ -224,6 +242,7 @@ describe('Test multiple pods', function () {
224 expect(video1.podUrl).to.equal('localhost:9003') 242 expect(video1.podUrl).to.equal('localhost:9003')
225 expect(video1.magnetUri).to.exist 243 expect(video1.magnetUri).to.exist
226 expect(video1.duration).to.equal(5) 244 expect(video1.duration).to.equal(5)
245 expect(video1.tags).to.deep.equal([ 'tag1p3' ])
227 expect(utils.dateIsValid(video1.createdDate)).to.be.true 246 expect(utils.dateIsValid(video1.createdDate)).to.be.true
228 247
229 expect(video2.name).to.equal('my super name for pod 3-2') 248 expect(video2.name).to.equal('my super name for pod 3-2')
@@ -231,6 +250,7 @@ describe('Test multiple pods', function () {
231 expect(video2.podUrl).to.equal('localhost:9003') 250 expect(video2.podUrl).to.equal('localhost:9003')
232 expect(video2.magnetUri).to.exist 251 expect(video2.magnetUri).to.exist
233 expect(video2.duration).to.equal(5) 252 expect(video2.duration).to.equal(5)
253 expect(video2.tags).to.deep.equal([ 'tag2p3', 'tag3p3', 'tag4p3' ])
234 expect(utils.dateIsValid(video2.createdDate)).to.be.true 254 expect(utils.dateIsValid(video2.createdDate)).to.be.true
235 255
236 if (server.url !== 'http://localhost:9003') { 256 if (server.url !== 'http://localhost:9003') {