mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
refs https://github.com/TryGhost/Toolbox/issues/152 - Passing around plain options object tends to become quite unreadable long term. While these new utils are being shaped up it's still easy to change interface and introduce new parameters with time as needed.
26 lines
850 B
JavaScript
26 lines
850 B
JavaScript
const should = require('should');
|
|
const testUtils = require('../../../../utils');
|
|
const localUtils = require('./utils');
|
|
const config = require('../../../../../core/shared/config');
|
|
|
|
describe('Config API', function () {
|
|
let request;
|
|
|
|
before(async function () {
|
|
request = await localUtils.getAuthenticatedAgent();
|
|
});
|
|
|
|
it('can retrieve config and all expected properties', async function () {
|
|
const res = await request
|
|
.get(localUtils.API.getApiQuery('site/'))
|
|
.set('Origin', config.get('url'))
|
|
.expect('Content-Type', /json/)
|
|
.expect('Cache-Control', testUtils.cacheRules.private)
|
|
.expect(200);
|
|
|
|
localUtils.API.checkResponse(res.body.site, 'site');
|
|
|
|
// minor (safe) version
|
|
res.body.site.version.should.match(/\d+\.\d+/);
|
|
});
|
|
});
|