2017-03-21 11:24:11 +03:00
|
|
|
var should = require('should'),
|
2017-12-14 05:01:23 +03:00
|
|
|
hbs = require.main.require('core/server/services/themes/engine'),
|
2017-04-04 19:07:35 +03:00
|
|
|
template = require.main.require('core/server/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
|
|
|
});
|