aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/singlePod.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/singlePod.js')
-rw-r--r--server/tests/api/singlePod.js26
1 files changed, 24 insertions, 2 deletions
diff --git a/server/tests/api/singlePod.js b/server/tests/api/singlePod.js
index 14f893f13..0b96f221a 100644
--- a/server/tests/api/singlePod.js
+++ b/server/tests/api/singlePod.js
@@ -68,7 +68,30 @@ describe('Test a single pod', function () {
68 expect(video.podUrl).to.equal('http://localhost:9001') 68 expect(video.podUrl).to.equal('http://localhost:9001')
69 expect(video.magnetUri).to.exist 69 expect(video.magnetUri).to.exist
70 70
71 video_id = video._id 71 video_id = video.id
72
73 webtorrent.add(video.magnetUri, function (torrent) {
74 expect(torrent.files).to.exist
75 expect(torrent.files.length).to.equal(1)
76 expect(torrent.files[0].path).to.exist.and.to.not.equal('')
77
78 done()
79 })
80 })
81 })
82
83 it('Should get the video', function (done) {
84 // Yes, this could be long
85 this.timeout(60000)
86
87 utils.getVideo(url, video_id, function (err, res) {
88 if (err) throw err
89
90 const video = res.body
91 expect(video.name).to.equal('my super name')
92 expect(video.description).to.equal('my super description')
93 expect(video.podUrl).to.equal('http://localhost:9001')
94 expect(video.magnetUri).to.exist
72 95
73 webtorrent.add(video.magnetUri, function (torrent) { 96 webtorrent.add(video.magnetUri, function (torrent) {
74 expect(torrent.files).to.exist 97 expect(torrent.files).to.exist
@@ -91,7 +114,6 @@ describe('Test a single pod', function () {
91 expect(video.name).to.equal('my super name') 114 expect(video.name).to.equal('my super name')
92 expect(video.description).to.equal('my super description') 115 expect(video.description).to.equal('my super description')
93 expect(video.podUrl).to.equal('http://localhost:9001') 116 expect(video.podUrl).to.equal('http://localhost:9001')
94 expect(video.magnetUri).to.exist
95 117
96 done() 118 done()
97 }) 119 })