0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/test/unit/web/api/v3/content/middleware_spec.js

17 lines
709 B
JavaScript

const should = require('should');
const middleware = require('../../../../../../core/server/web/api/v3/content/middleware');
describe('Content Api v3 middleware', function () {
it('exports an authenticatePublic middleware', function () {
should.exist(middleware.authenticatePublic);
});
describe('authenticatePublic', function () {
it('uses brute content api middleware as the first middleware in the chain', function () {
const firstMiddleware = middleware.authenticatePublic[0];
const brute = require('../../../../../../core/server/web/shared/middlewares/brute');
should.equal(firstMiddleware, brute.contentApiKey);
});
});
});