2021-12-08 12:00:45 +03:00
|
|
|
const {expect} = require('chai');
|
|
|
|
const {any, stringMatching} = require('expect');
|
2021-12-09 16:59:46 +03:00
|
|
|
|
2021-12-07 12:51:08 +03:00
|
|
|
const framework = require('../../../../utils/e2e-framework');
|
2021-03-09 12:10:27 +03:00
|
|
|
|
|
|
|
describe('Config API', function () {
|
|
|
|
let request;
|
|
|
|
|
|
|
|
before(async function () {
|
2021-12-07 19:23:22 +03:00
|
|
|
request = await framework.getAgent('/ghost/api/canary/admin/');
|
2021-03-09 12:10:27 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
it('can retrieve config and all expected properties', async function () {
|
|
|
|
const res = await request
|
2021-12-10 10:05:37 +03:00
|
|
|
.get('site/');
|
2021-03-09 12:10:27 +03:00
|
|
|
|
2021-12-08 12:00:45 +03:00
|
|
|
expect(res.body.site).to.matchSnapshot({
|
|
|
|
version: stringMatching(/\d+\.\d+/)
|
|
|
|
});
|
|
|
|
expect(res.headers).to.matchSnapshot({
|
|
|
|
date: any(String),
|
|
|
|
etag: any(String)
|
|
|
|
});
|
2021-03-09 12:10:27 +03:00
|
|
|
});
|
|
|
|
});
|