]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix typos in server tests
authorChocobozzz <florian.bigard@gmail.com>
Fri, 13 May 2016 13:27:31 +0000 (15:27 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Fri, 13 May 2016 13:27:31 +0000 (15:27 +0200)
server/tests/api/checkParams.js
server/tests/api/friendsAdvanced.js
server/tests/api/multiplePods.js
server/tests/api/singlePod.js

index 71113fd396df4fe64f57c9b83324e4e9fef20d4a..1f47e5ef46bfd62d4e6eed46de44e0a6d0aba603 100644 (file)
@@ -59,7 +59,7 @@ describe('Test parameters validator', function () {
       function (next) {
         utils.loginAndGetAccessToken(server, function (err, token) {
           if (err) throw err
-          server.access_token = token
+          server.accessToken = token
 
           next()
         })
@@ -138,7 +138,7 @@ describe('Test parameters validator', function () {
       it('Should fail with nothing', function (done) {
         const data = {}
         const attach = {}
-        makePostRequest(path, server.access_token, data, attach, done)
+        makePostRequest(path, server.accessToken, data, attach, done)
       })
 
       it('Should fail without name', function (done) {
@@ -148,7 +148,7 @@ describe('Test parameters validator', function () {
         const attach = {
           'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
         }
-        makePostRequest(path, server.access_token, data, attach, done)
+        makePostRequest(path, server.accessToken, data, attach, done)
       })
 
       it('Should fail with a long name', function (done) {
@@ -159,7 +159,7 @@ describe('Test parameters validator', function () {
         const attach = {
           'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
         }
-        makePostRequest(path, server.access_token, data, attach, done)
+        makePostRequest(path, server.accessToken, data, attach, done)
       })
 
       it('Should fail without description', function (done) {
@@ -169,7 +169,7 @@ describe('Test parameters validator', function () {
         const attach = {
           'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
         }
-        makePostRequest(path, server.access_token, data, attach, done)
+        makePostRequest(path, server.accessToken, data, attach, done)
       })
 
       it('Should fail with a long description', function (done) {
@@ -182,7 +182,7 @@ describe('Test parameters validator', function () {
         const attach = {
           'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
         }
-        makePostRequest(path, server.access_token, data, attach, done)
+        makePostRequest(path, server.accessToken, data, attach, done)
       })
 
       it('Should fail without an input file', function (done) {
@@ -191,7 +191,7 @@ describe('Test parameters validator', function () {
           description: 'my super description'
         }
         const attach = {}
-        makePostRequest(path, server.access_token, data, attach, done)
+        makePostRequest(path, server.accessToken, data, attach, done)
       })
 
       it('Should fail without an incorrect input file', function (done) {
@@ -202,7 +202,7 @@ describe('Test parameters validator', function () {
         const attach = {
           'videofile': pathUtils.join(__dirname, '..', 'fixtures', 'video_short_fake.webm')
         }
-        makePostRequest(path, server.access_token, data, attach, done)
+        makePostRequest(path, server.accessToken, data, attach, done)
       })
 
       it('Should succeed with the correct parameters', function (done) {
@@ -213,11 +213,11 @@ describe('Test parameters validator', function () {
         const attach = {
           'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
         }
-        makePostRequest(path, server.access_token, data, attach, function () {
+        makePostRequest(path, server.accessToken, data, attach, function () {
           attach.videofile = pathUtils.join(__dirname, 'fixtures', 'video_short.mp4')
-          makePostRequest(path, server.access_token, data, attach, function () {
+          makePostRequest(path, server.accessToken, data, attach, function () {
             attach.videofile = pathUtils.join(__dirname, 'fixtures', 'video_short.ogv')
-            makePostRequest(path, server.access_token, data, attach, done, true)
+            makePostRequest(path, server.accessToken, data, attach, done, true)
           }, true)
         }, true)
       })
@@ -261,21 +261,21 @@ describe('Test parameters validator', function () {
       it('Should have 404 with nothing', function (done) {
         request(server.url)
           .delete(path)
-          .set('Authorization', 'Bearer ' + server.access_token)
+          .set('Authorization', 'Bearer ' + server.accessToken)
           .expect(400, done)
       })
 
       it('Should fail without a mongodb id', function (done) {
         request(server.url)
           .delete(path + 'hello')
-          .set('Authorization', 'Bearer ' + server.access_token)
+          .set('Authorization', 'Bearer ' + server.accessToken)
           .expect(400, done)
       })
 
       it('Should fail with a video which does not exist', function (done) {
         request(server.url)
           .delete(path + '123456789012345678901234')
-          .set('Authorization', 'Bearer ' + server.access_token)
+          .set('Authorization', 'Bearer ' + server.accessToken)
           .expect(404, done)
       })
 
index 833a530ddc8b431ceec117e70e4bd870388bf658..9bd202a0582e464597e6b21de820b37129e616f1 100644 (file)
@@ -27,7 +27,7 @@ describe('Test advanced friends', function () {
     const fixture = 'video_short.webm'
     const server = servers[podNumber - 1]
 
-    return utils.uploadVideo(server.url, server.access_token, name, description, fixture, callback)
+    return utils.uploadVideo(server.url, server.accessToken, name, description, fixture, callback)
   }
 
   function getVideos (podNumber, callback) {
index f1415f6f14ba2a3d90d96fed84c9187b5f8f72e0..1a61034fc4c7bd7bb86c06e927142ade415269fd 100644 (file)
@@ -72,7 +72,7 @@ describe('Test multiple pods', function () {
 
       async.series([
         function (next) {
-          utils.uploadVideo(servers[0].url, servers[0].access_token, 'my super name for pod 1', 'my super description for pod 1', 'video_short1.webm', next)
+          utils.uploadVideo(servers[0].url, servers[0].accessToken, 'my super name for pod 1', 'my super description for pod 1', 'video_short1.webm', next)
         },
         function (next) {
           setTimeout(next, 11000)
@@ -127,7 +127,7 @@ describe('Test multiple pods', function () {
 
       async.series([
         function (next) {
-          utils.uploadVideo(servers[1].url, servers[1].access_token, 'my super name for pod 2', 'my super description for pod 2', 'video_short2.webm', next)
+          utils.uploadVideo(servers[1].url, servers[1].accessToken, 'my super name for pod 2', 'my super description for pod 2', 'video_short2.webm', next)
         },
         function (next) {
           setTimeout(next, 11000)
@@ -182,10 +182,10 @@ describe('Test multiple pods', function () {
 
       async.series([
         function (next) {
-          utils.uploadVideo(servers[2].url, servers[2].access_token, 'my super name for pod 3', 'my super description for pod 3', 'video_short3.webm', next)
+          utils.uploadVideo(servers[2].url, servers[2].accessToken, 'my super name for pod 3', 'my super description for pod 3', 'video_short3.webm', next)
         },
         function (next) {
-          utils.uploadVideo(servers[2].url, servers[2].access_token, 'my super name for pod 3-2', 'my super description for pod 3-2', 'video_short.webm', next)
+          utils.uploadVideo(servers[2].url, servers[2].accessToken, 'my super name for pod 3-2', 'my super description for pod 3-2', 'video_short.webm', next)
         },
         function (next) {
           setTimeout(next, 22000)
index 542dea430edb5a1ffa64fa634a4a60e8e591bc1a..0d0e6a82ef27469dafaf86f24c0f586da68d1408 100644 (file)
@@ -32,7 +32,7 @@ describe('Test a single pod', function () {
       function (next) {
         utils.loginAndGetAccessToken(server, function (err, token) {
           if (err) throw err
-          server.access_token = token
+          server.accessToken = token
           next()
         })
       },
@@ -55,7 +55,7 @@ describe('Test a single pod', function () {
 
   it('Should upload the video', function (done) {
     this.timeout(5000)
-    utils.uploadVideo(server.url, server.access_token, 'my super name', 'my super description', 'video_short.webm', done)
+    utils.uploadVideo(server.url, server.accessToken, 'my super name', 'my super description', 'video_short.webm', done)
   })
 
   it('Should seed the uploaded video', function (done) {
@@ -87,7 +87,8 @@ describe('Test a single pod', function () {
           expect(torrent.files.length).to.equal(1)
           expect(torrent.files[0].path).to.exist.and.to.not.equal('')
 
-          done()
+          // We remove it because we'll add it again
+          webtorrent.remove(video.magnetUri, done)
         })
       })
     })