Ghost/core/test/unit/helpers/template_spec.js
Katharina Irrgang bfade9f50d Tests: Renamed unit/server_helpers to unit/helpers (#9145)
no issue

- nothing to explain 😁
2017-10-19 12:02:21 +01:00

17 lines
547 B
JavaScript

var should = require('should'),
hbs = require.main.require('core/server/themes/engine'),
// Stuff we are testing
template = require.main.require('core/server/helpers/template');
describe('Helpers Template', function () {
it('can execute a template', function () {
hbs.registerPartial('test', '<h1>Hello {{name}}</h1>');
var safeString = template.execute('test', {name: 'world'});
should.exist(safeString);
safeString.should.have.property('string').and.equal('<h1>Hello world</h1>');
});
});