aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/singlePod.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-03-18 16:28:09 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-03-18 16:28:09 +0100
commit2df82d42cb57783cd90ccfc11fc8ffe4b95ebb70 (patch)
tree9c177f135a121ee34ed2e4f529dd2cacc3ad3f87 /server/tests/api/singlePod.js
parentf0f5567b6918fc60c8cab15e13aec03a89a91dfb (diff)
downloadPeerTube-2df82d42cb57783cd90ccfc11fc8ffe4b95ebb70.tar.gz
PeerTube-2df82d42cb57783cd90ccfc11fc8ffe4b95ebb70.tar.zst
PeerTube-2df82d42cb57783cd90ccfc11fc8ffe4b95ebb70.zip
Change api output for videos
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 })