mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
63b7ef7dc6
refs https://github.com/TryGhost/Team/issues/1217 - moved top-level `tenorApiKey` to `tenor:apiKey` and added `tenor:contentFilter` - added base config to `defaults.json` - updated `public-config.js` and API output serializer to use the new top-level `tenor` key
38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
const should = require('should');
|
|
const supertest = require('supertest');
|
|
const testUtils = require('../../utils');
|
|
const localUtils = require('./utils');
|
|
const config = require('../../../core/shared/config');
|
|
const configUtils = require('../../utils/configUtils');
|
|
|
|
describe('Config API', function () {
|
|
let request;
|
|
|
|
before(async function () {
|
|
await testUtils.startGhost();
|
|
request = supertest.agent(config.get('url'));
|
|
await localUtils.doAuth(request);
|
|
});
|
|
|
|
afterEach(function () {
|
|
configUtils.set('tenor:apiKey', undefined);
|
|
});
|
|
|
|
it('can retrieve config and all expected properties', async function () {
|
|
// set any non-default keys so we can be sure they're exposed
|
|
configUtils.set('tenor:apiKey', 'TENOR_KEY');
|
|
|
|
const res = await request
|
|
.get(localUtils.API.getApiQuery('config/'))
|
|
.set('Origin', config.get('url'))
|
|
.expect('Content-Type', /json/)
|
|
.expect('Cache-Control', testUtils.cacheRules.private)
|
|
.expect(200);
|
|
|
|
localUtils.API.checkResponse(res.body.config, 'config');
|
|
|
|
// full version
|
|
res.body.config.version.should.match(/\d+\.\d+\.\d+/);
|
|
});
|
|
});
|