+ })
+
+ describe('Should manipulate these videos', function () {
+ it('Should update the video 3 by asking pod 3', function (done) {
+ this.timeout(15000)
+
+ const name = 'my super video updated'
+ const description = 'my super description updated'
+ const tags = [ 'tagup1', 'tagup2' ]
+
+ videosUtils.updateVideo(servers[2].url, servers[2].accessToken, toRemove[0].id, name, description, tags, function (err) {
+ if (err) throw err
+
+ setTimeout(done, 11000)
+ })
+ })
+
+ it('Should have the video 3 updated on each pod', function (done) {
+ this.timeout(200000)
+
+ each(servers, function (server, callback) {
+ // Avoid "duplicate torrent" errors
+ const webtorrent = new WebTorrent()
+
+ videosUtils.getVideosList(server.url, function (err, res) {
+ if (err) throw err
+
+ const videos = res.body.data
+ const videoUpdated = videos.find(function (video) {
+ return video.name === 'my super video updated'
+ })
+
+ expect(!!videoUpdated).to.be.true
+ expect(videoUpdated.description).to.equal('my super description updated')
+ expect(videoUpdated.tags).to.deep.equal([ 'tagup1', 'tagup2' ])
+ expect(miscsUtils.dateIsValid(videoUpdated.updatedAt, 20000)).to.be.true
+
+ videosUtils.testVideoImage(server.url, 'video_short3.webm', videoUpdated.thumbnailPath, function (err, test) {
+ if (err) throw err
+ expect(test).to.equal(true)
+
+ webtorrent.add(videoUpdated.magnetUri, function (torrent) {
+ expect(torrent.files).to.exist
+ expect(torrent.files.length).to.equal(1)
+ expect(torrent.files[0].path).to.exist.and.to.not.equal('')
+
+ webtorrent.remove(videoUpdated.magnetUri, callback)
+ })
+ })
+ })
+ }, done)
+ })