mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
1bbaf65a22
- The index.js file was actually loader code - It was mainly used by the unit tests, which needed to be rewritten to get each helper individually
29 lines
680 B
JavaScript
29 lines
680 B
JavaScript
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);
|
|
});
|
|
});
|
|
});
|