diff options
Diffstat (limited to 'server/tests/api/singlePod.js')
-rw-r--r-- | server/tests/api/singlePod.js | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/server/tests/api/singlePod.js b/server/tests/api/singlePod.js index e8b578770..542dea430 100644 --- a/server/tests/api/singlePod.js +++ b/server/tests/api/singlePod.js | |||
@@ -14,7 +14,7 @@ const utils = require('./utils') | |||
14 | 14 | ||
15 | describe('Test a single pod', function () { | 15 | describe('Test a single pod', function () { |
16 | let server = null | 16 | let server = null |
17 | let video_id = -1 | 17 | let videoId = -1 |
18 | 18 | ||
19 | before(function (done) { | 19 | before(function (done) { |
20 | this.timeout(20000) | 20 | this.timeout(20000) |
@@ -80,7 +80,7 @@ describe('Test a single pod', function () { | |||
80 | if (err) throw err | 80 | if (err) throw err |
81 | expect(test).to.equal(true) | 81 | expect(test).to.equal(true) |
82 | 82 | ||
83 | video_id = video.id | 83 | videoId = video.id |
84 | 84 | ||
85 | webtorrent.add(video.magnetUri, function (torrent) { | 85 | webtorrent.add(video.magnetUri, function (torrent) { |
86 | expect(torrent.files).to.exist | 86 | expect(torrent.files).to.exist |
@@ -97,7 +97,7 @@ describe('Test a single pod', function () { | |||
97 | // Yes, this could be long | 97 | // Yes, this could be long |
98 | this.timeout(60000) | 98 | this.timeout(60000) |
99 | 99 | ||
100 | utils.getVideo(server.url, video_id, function (err, res) { | 100 | utils.getVideo(server.url, videoId, function (err, res) { |
101 | if (err) throw err | 101 | if (err) throw err |
102 | 102 | ||
103 | const video = res.body | 103 | const video = res.body |
@@ -158,7 +158,7 @@ describe('Test a single pod', function () { | |||
158 | }) | 158 | }) |
159 | 159 | ||
160 | it('Should remove the video', function (done) { | 160 | it('Should remove the video', function (done) { |
161 | utils.removeVideo(server.url, server.access_token, video_id, function (err) { | 161 | utils.removeVideo(server.url, server.accessToken, videoId, function (err) { |
162 | if (err) throw err | 162 | if (err) throw err |
163 | 163 | ||
164 | fs.readdir(pathUtils.join(__dirname, '../../../test1/uploads/'), function (err, files) { | 164 | fs.readdir(pathUtils.join(__dirname, '../../../test1/uploads/'), function (err, files) { |
@@ -187,8 +187,8 @@ describe('Test a single pod', function () { | |||
187 | 'video_short.mp4', 'video_short.ogv', 'video_short.webm', | 187 | 'video_short.mp4', 'video_short.ogv', 'video_short.webm', |
188 | 'video_short1.webm', 'video_short2.webm', 'video_short3.webm' | 188 | 'video_short1.webm', 'video_short2.webm', 'video_short3.webm' |
189 | ] | 189 | ] |
190 | async.each(videos, function (video, callback_each) { | 190 | async.each(videos, function (video, callbackEach) { |
191 | utils.uploadVideo(server.url, server.access_token, video + ' name', video + ' description', video, callback_each) | 191 | utils.uploadVideo(server.url, server.accessToken, video + ' name', video + ' description', video, callbackEach) |
192 | }, done) | 192 | }, done) |
193 | }) | 193 | }) |
194 | 194 | ||
@@ -200,13 +200,13 @@ describe('Test a single pod', function () { | |||
200 | expect(videos).to.be.an('array') | 200 | expect(videos).to.be.an('array') |
201 | expect(videos.length).to.equal(6) | 201 | expect(videos.length).to.equal(6) |
202 | 202 | ||
203 | const videos_by_name = keyBy(videos, 'name') | 203 | const videosByName = keyBy(videos, 'name') |
204 | expect(videos_by_name['video_short.mp4 name'].duration).to.equal(5) | 204 | expect(videosByName['video_short.mp4 name'].duration).to.equal(5) |
205 | expect(videos_by_name['video_short.ogv name'].duration).to.equal(5) | 205 | expect(videosByName['video_short.ogv name'].duration).to.equal(5) |
206 | expect(videos_by_name['video_short.webm name'].duration).to.equal(5) | 206 | expect(videosByName['video_short.webm name'].duration).to.equal(5) |
207 | expect(videos_by_name['video_short1.webm name'].duration).to.equal(10) | 207 | expect(videosByName['video_short1.webm name'].duration).to.equal(10) |
208 | expect(videos_by_name['video_short2.webm name'].duration).to.equal(5) | 208 | expect(videosByName['video_short2.webm name'].duration).to.equal(5) |
209 | expect(videos_by_name['video_short3.webm name'].duration).to.equal(5) | 209 | expect(videosByName['video_short3.webm name'].duration).to.equal(5) |
210 | 210 | ||
211 | done() | 211 | done() |
212 | }) | 212 | }) |
@@ -216,15 +216,15 @@ describe('Test a single pod', function () { | |||
216 | utils.getVideosList(server.url, function (err, res) { | 216 | utils.getVideosList(server.url, function (err, res) { |
217 | const videos = res.body | 217 | const videos = res.body |
218 | 218 | ||
219 | async.each(videos, function (video, callback_each) { | 219 | async.each(videos, function (video, callbackEach) { |
220 | if (err) throw err | 220 | if (err) throw err |
221 | const video_name = video.name.replace(' name', '') | 221 | const videoName = video.name.replace(' name', '') |
222 | 222 | ||
223 | utils.testImage(server.url, video_name, video.thumbnailPath, function (err, test) { | 223 | utils.testImage(server.url, videoName, video.thumbnailPath, function (err, test) { |
224 | if (err) throw err | 224 | if (err) throw err |
225 | 225 | ||
226 | expect(test).to.equal(true) | 226 | expect(test).to.equal(true) |
227 | callback_each() | 227 | callbackEach() |
228 | }) | 228 | }) |
229 | }, done) | 229 | }, done) |
230 | }) | 230 | }) |