Ghost/test/unit/helpers/lang.test.js

29 lines
680 B
JavaScript
Raw Normal View History

const should = require('should');
const lang = require('../../../core/frontend/helpers/lang');
describe('{{lang}} helper', function () {
it('returns correct language tag', function () {
const locales = [
'en',
'en-gb',
'de'
];
locales.forEach((locale) => {
const context = {
hash: {},
data: {
site: {
locale
}
}
};
let rendered = lang.call({}, context);
should.exist(rendered);
rendered.string.should.equal(locale);
});
});
});