From f5a60a5138135a3412dfbcfd6e564f7aa47a55c2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 6 Nov 2015 17:34:15 +0100 Subject: Add API versionning --- test/api/friends.js | 4 ++-- test/api/multiplePods.js | 4 ++-- test/api/singlePod.js | 11 +++++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/api/friends.js b/test/api/friends.js index 033d3799a..845ccd1a8 100644 --- a/test/api/friends.js +++ b/test/api/friends.js @@ -9,7 +9,7 @@ var utils = require('../utils') function getFriendsList (url, end) { - var path = '/api/pods/' + var path = '/api/v1/pods/' request(url) .get(path) @@ -75,7 +75,7 @@ }) } - var path = '/api/pods/makefriends' + var path = '/api/v1/pods/makefriends' // The second pod make friend with the third request(urls[1]) diff --git a/test/api/multiplePods.js b/test/api/multiplePods.js index 3b69738f4..1edfc1ce3 100644 --- a/test/api/multiplePods.js +++ b/test/api/multiplePods.js @@ -11,7 +11,7 @@ webtorrent.silent = true describe('Test multiple pods', function () { - var path = '/api/videos' + var path = '/api/v1/videos' var apps = [] var urls = [] var video_id = -1 @@ -38,7 +38,7 @@ before(function (done) { this.timeout(30000) - var path_friends = '/api/pods/makefriends' + var path_friends = '/api/v1/pods/makefriends' utils.runMultipleServers(3, function (apps_run, urls_run) { apps = apps_run diff --git a/test/api/singlePod.js b/test/api/singlePod.js index 5c4c892bb..bc9243c1c 100644 --- a/test/api/singlePod.js +++ b/test/api/singlePod.js @@ -3,6 +3,7 @@ var request = require('supertest') var chai = require('chai') + var fs = require('fs') var expect = chai.expect var webtorrent = require(__dirname + '/../../src/webTorrentNode') webtorrent.silent = true @@ -10,7 +11,7 @@ var utils = require('../utils') describe('Test a single pod', function () { - var path = '/api/videos' + var path = '/api/v1/videos' var app = null var url = '' var video_id = -1 @@ -98,7 +99,13 @@ .expect(204) .end(function (err, res) { if (err) throw err - done() + + fs.readdir(__dirname + '/../../test1/uploads/', function (err, files) { + if (err) throw err + + expect(files.length).to.equal(0) + done() + }) }) }) -- cgit v1.2.3