2017-03-21 08:24:11 +00:00
|
|
|
var should = require('should'),
|
2019-06-19 11:30:28 +02:00
|
|
|
hbs = require.main.require('core/frontend/services/themes/engine'),
|
|
|
|
template = require.main.require('core/frontend/helpers/template');
|
2013-11-27 21:45:01 -05:00
|
|
|
|
|
|
|
describe('Helpers Template', function () {
|
2014-06-04 22:26:03 +01:00
|
|
|
it('can execute a template', function () {
|
2013-12-01 18:31:55 -05:00
|
|
|
hbs.registerPartial('test', '<h1>Hello {{name}}</h1>');
|
2013-11-27 21:45:01 -05:00
|
|
|
|
2013-12-01 18:31:55 -05:00
|
|
|
var safeString = template.execute('test', {name: 'world'});
|
2013-11-27 21:45:01 -05:00
|
|
|
|
2013-12-01 18:31:55 -05:00
|
|
|
should.exist(safeString);
|
|
|
|
safeString.should.have.property('string').and.equal('<h1>Hello world</h1>');
|
2013-11-27 21:45:01 -05:00
|
|
|
});
|
2014-09-10 00:06:24 -04:00
|
|
|
});
|