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