2018-01-09 16:50:57 +03:00
|
|
|
const should = require('should'),
|
|
|
|
settingsCache = require('../../../server/services/settings/cache'),
|
2019-06-19 12:30:28 +03:00
|
|
|
helpers = require('../../../frontend/helpers'),
|
|
|
|
proxy = require('../../../frontend/helpers/proxy');
|
2018-01-09 16:50:57 +03:00
|
|
|
|
|
|
|
describe('{{lang}} helper', function () {
|
|
|
|
beforeEach(function () {
|
|
|
|
settingsCache.set('default_locale', {value: 'en'});
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(function () {
|
|
|
|
settingsCache.shutdown();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('returns correct language tag', function () {
|
|
|
|
let expected = proxy.i18n.locale(),
|
|
|
|
rendered = helpers.lang.call();
|
|
|
|
|
|
|
|
should.exist(rendered);
|
|
|
|
rendered.string.should.equal(expected);
|
|
|
|
});
|
|
|
|
});
|