0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/test/regression/api/canary/admin/site.test.js
Naz 6762e2a60d Started a greenfield e2e test framework
refs https://github.com/TryGhost/Toolbox/issues/129

- Having a fresh module should allow building new testing utility concepts from the ground up without being tied by the mystery baggage of the legacy localUtils/testUtils
- The outline of the concepts the framework will be handling is in the commont on the top of the e2e-framework file
2021-12-09 22:20:54 +13:00

27 lines
898 B
JavaScript

const should = require('should');
const framework = require('../../../../utils/e2e-framework');
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 framework.getAgent();
});
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+/);
});
});