diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-12-11 21:50:51 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-12-19 21:22:28 +0100 |
commit | feb4bdfd9b46e87aadfa7c0d5338cde887d1f58c (patch) | |
tree | 2abc9fbc9569760e218fd52835850b757344b420 /server/tests/api/requests.js | |
parent | 108626609eda75e4ecc0a83a650a4d53c46220e0 (diff) | |
download | PeerTube-feb4bdfd9b46e87aadfa7c0d5338cde887d1f58c.tar.gz PeerTube-feb4bdfd9b46e87aadfa7c0d5338cde887d1f58c.tar.zst PeerTube-feb4bdfd9b46e87aadfa7c0d5338cde887d1f58c.zip |
First version with PostgreSQL
Diffstat (limited to 'server/tests/api/requests.js')
-rw-r--r-- | server/tests/api/requests.js | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/server/tests/api/requests.js b/server/tests/api/requests.js index af36f6e34..7e790b54b 100644 --- a/server/tests/api/requests.js +++ b/server/tests/api/requests.js | |||
@@ -69,7 +69,7 @@ describe('Test requests stats', function () { | |||
69 | }) | 69 | }) |
70 | }) | 70 | }) |
71 | 71 | ||
72 | it('Should have the correct request', function (done) { | 72 | it('Should have the correct total request', function (done) { |
73 | this.timeout(15000) | 73 | this.timeout(15000) |
74 | 74 | ||
75 | const server = servers[0] | 75 | const server = servers[0] |
@@ -83,11 +83,7 @@ describe('Test requests stats', function () { | |||
83 | if (err) throw err | 83 | if (err) throw err |
84 | 84 | ||
85 | const body = res.body | 85 | const body = res.body |
86 | expect(body.requests).to.have.lengthOf(1) | 86 | expect(body.totalRequests).to.equal(1) |
87 | |||
88 | const request = body.requests[0] | ||
89 | expect(request.to).to.have.lengthOf(1) | ||
90 | expect(request.request.type).to.equal('add') | ||
91 | 87 | ||
92 | // Wait one cycle | 88 | // Wait one cycle |
93 | setTimeout(done, 10000) | 89 | setTimeout(done, 10000) |
@@ -95,27 +91,6 @@ describe('Test requests stats', function () { | |||
95 | }) | 91 | }) |
96 | }) | 92 | }) |
97 | 93 | ||
98 | it('Should have the correct requests', function (done) { | ||
99 | const server = servers[0] | ||
100 | |||
101 | uploadVideo(server, function (err) { | ||
102 | if (err) throw err | ||
103 | |||
104 | getRequestsStats(server, function (err, res) { | ||
105 | if (err) throw err | ||
106 | |||
107 | const body = res.body | ||
108 | expect(body.requests).to.have.lengthOf(2) | ||
109 | |||
110 | const request = body.requests[1] | ||
111 | expect(request.to).to.have.lengthOf(1) | ||
112 | expect(request.request.type).to.equal('add') | ||
113 | |||
114 | done() | ||
115 | }) | ||
116 | }) | ||
117 | }) | ||
118 | |||
119 | after(function (done) { | 94 | after(function (done) { |
120 | process.kill(-servers[0].app.pid) | 95 | process.kill(-servers[0].app.pid) |
121 | 96 | ||