mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
f4ad3b23ba
refs https://github.com/TryGhost/Toolbox/issues/129 - The "Origin" header is require in Admin API requests so it makes sense to bake it into a default request made by most tests. Reduces unnecesary fluf around test request setup and removes a "config" dependency in each tests suite using the "e2e framework"
25 lines
695 B
JavaScript
25 lines
695 B
JavaScript
const {expect} = require('chai');
|
|
const {any, stringMatching} = require('expect');
|
|
|
|
const framework = require('../../../../utils/e2e-framework');
|
|
|
|
describe('Config API', function () {
|
|
let request;
|
|
|
|
before(async function () {
|
|
request = await framework.getAgent('/ghost/api/canary/admin/');
|
|
});
|
|
|
|
it('can retrieve config and all expected properties', async function () {
|
|
const res = await request
|
|
.get('site/');
|
|
|
|
expect(res.body.site).to.matchSnapshot({
|
|
version: stringMatching(/\d+\.\d+/)
|
|
});
|
|
expect(res.headers).to.matchSnapshot({
|
|
date: any(String),
|
|
etag: any(String)
|
|
});
|
|
});
|
|
});
|