describe('Test a single pod', function () {
let server = null
let videoId = -1
+ let videoUUID = ''
let videosListBase = null
before(function (done) {
expect(test).to.equal(true)
videoId = video.id
+ videoUUID = video.uuid
webtorrent.add(video.magnetUri, function (torrent) {
expect(torrent.files).to.exist
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()
})