var should = require('should'),
sinon = require('sinon'),
helpers = require('../../../core/frontend/helpers'),
proxy = require('../../../core/frontend/helpers/proxy'),
settingsCache = proxy.settingsCache;
describe('{{ghost_foot}} helper', function () {
var settingsCacheStub;
afterEach(function () {
sinon.restore();
});
beforeEach(function () {
settingsCacheStub = sinon.stub(settingsCache, 'get');
});
it('outputs global injected code', function () {
settingsCacheStub.withArgs('ghost_foot').returns('');
const rendered = helpers.ghost_foot({data: {}});
should.exist(rendered);
rendered.string.should.match(/');
const rendered = helpers.ghost_foot({
data: {
root: {
post: {
codeinjection_foot: 'post-codeinjection'
}
}
}
});
should.exist(rendered);
rendered.string.should.match(/');
const rendered = helpers.ghost_foot({
data: {
root: {
post: {
codeinjection_foot: null
}
}
}
});
should.exist(rendered);
rendered.string.should.match(/');
const rendered = helpers.ghost_foot({
data: {
root: {
post: {
codeinjection_foot: ''
}
}
}
});
should.exist(rendered);
rendered.string.should.match(/