From 0a6658fdcbd779ada8f3758048c326e997902d5a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Jul 2017 16:01:56 +0200 Subject: Use global uuid instead of remoteId for videos --- server/tests/api/single-pod.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'server/tests/api/single-pod.js') diff --git a/server/tests/api/single-pod.js b/server/tests/api/single-pod.js index e08da0517..0dac9a183 100644 --- a/server/tests/api/single-pod.js +++ b/server/tests/api/single-pod.js @@ -19,6 +19,7 @@ const videosUtils = require('../utils/videos') describe('Test a single pod', function () { let server = null let videoId = -1 + let videoUUID = '' let videosListBase = null before(function (done) { @@ -140,6 +141,7 @@ describe('Test a single pod', function () { expect(test).to.equal(true) videoId = video.id + videoUUID = video.uuid webtorrent.add(video.magnetUri, function (torrent) { expect(torrent.files).to.exist @@ -181,18 +183,33 @@ describe('Test a single pod', function () { if (err) throw err expect(test).to.equal(true) - // Wait the async views increment + // Wait the async views increment setTimeout(done, 500) }) }) }) + it('Should get the video by UUID', function (done) { + // Yes, this could be long + this.timeout(60000) + + videosUtils.getVideo(server.url, videoUUID, function (err, res) { + if (err) throw err + + const video = res.body + expect(video.name).to.equal('my super name') + + // Wait the async views increment + setTimeout(done, 500) + }) + }) + it('Should have the views updated', function (done) { videosUtils.getVideo(server.url, videoId, function (err, res) { if (err) throw err const video = res.body - expect(video.views).to.equal(1) + expect(video.views).to.equal(2) done() }) -- cgit v1.2.3