Ghost/test/unit/helpers/lang_spec.js
Nazar Gargol c4dff2d50e Renamed settings keys from default_locale to lang
refs #10318
refs 2614565d5a

- Renames default_locale settings key as introduced in referenced
migration
2020-06-24 14:07:24 +12:00

23 lines
677 B
JavaScript

const should = require('should');
const settingsCache = require('../../../core/server/services/settings/cache');
const helpers = require('../../../core/frontend/helpers');
const proxy = require('../../../core/frontend/services/proxy');
describe('{{lang}} helper', function () {
beforeEach(function () {
settingsCache.set('lang', {value: 'en'});
});
afterEach(function () {
settingsCache.shutdown();
});
it('returns correct language tag', function () {
let expected = proxy.themeI18n.locale();
let rendered = helpers.lang.call();
should.exist(rendered);
rendered.string.should.equal(expected);
});
});