2019-01-07 21:25:19 +07:00
|
|
|
const should = require('should');
|
2020-03-30 16:26:47 +01:00
|
|
|
const spamPrevention = require('../../../../../../core/server/web/shared/middlewares/api/spam-prevention');
|
2019-01-07 21:25:19 +07:00
|
|
|
|
|
|
|
describe('Spam Prevention', function () {
|
|
|
|
it('exports a contentApiKey method', function () {
|
|
|
|
should.equal(typeof spamPrevention.contentApiKey, 'function');
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('contentApiKey method', function () {
|
|
|
|
it('returns an instance of express-brute', function () {
|
|
|
|
const ExpressBrute = require('express-brute');
|
|
|
|
const result = spamPrevention.contentApiKey();
|
|
|
|
|
|
|
|
should.equal(result instanceof ExpressBrute, true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|