0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

fix: spam prevention spec (#6992)

closes #6991
This commit is contained in:
zhenkyle 2016-07-14 22:11:58 +08:00 committed by Katharina Irrgang
parent 9f547b640f
commit 76808d43b3

View file

@ -1,5 +1,6 @@
var should = require('should'),
sinon = require('sinon'),
rewire = require('rewire'),
middleware = require('../../../server/middleware').middleware;
describe('Middleware: spamPrevention', function () {
@ -18,6 +19,7 @@ describe('Middleware: spamPrevention', function () {
spyNext = sinon.spy(function (param) {
error = param;
});
middleware.spamPrevention = rewire('../../../server/middleware/spam-prevention');
});
afterEach(function () {
@ -84,7 +86,7 @@ describe('Middleware: spamPrevention', function () {
// fast forward 1 hour
process.hrtime.restore();
stub = sinon.stub(process, 'hrtime', function () {
return [3700000, 10];
return [3610, 10];
});
middleware.spamPrevention.signin(req, null, spyNext);