mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
- This is a minor bugbare, but it will affect some configuration I'm about to do for c8 - I've been wanting to do it for ages, middleware is plural all on it's own so it's an odd affectation in our codebase - This also only exists in 2 places, everywhere else we use "middleware" - Sadly it did result in a lot of churn as I did a full find and replace, but consistency is king!
17 lines
645 B
JavaScript
17 lines
645 B
JavaScript
const should = require('should');
|
|
const spamPrevention = require('../../../../../../../core/server/web/shared/middleware/api/spam-prevention');
|
|
|
|
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);
|
|
});
|
|
});
|
|
});
|