2013-11-27 21:45:01 -05:00
|
|
|
/*globals describe, beforeEach, it*/
|
|
|
|
var testUtils = require('../utils'),
|
2013-12-06 09:51:35 +01:00
|
|
|
should = require('should'),
|
|
|
|
sinon = require('sinon'),
|
|
|
|
when = require('when'),
|
|
|
|
_ = require('underscore'),
|
|
|
|
path = require('path'),
|
2013-12-01 18:31:55 -05:00
|
|
|
hbs = require('express-hbs'),
|
2013-11-27 21:45:01 -05:00
|
|
|
|
|
|
|
// Stuff we are testing
|
|
|
|
config = require('../../server/config'),
|
2013-12-06 09:51:35 +01:00
|
|
|
api = require('../../server/api'),
|
2013-11-27 21:45:01 -05:00
|
|
|
template = require('../../server/helpers/template');
|
|
|
|
|
|
|
|
describe('Helpers Template', function () {
|
|
|
|
|
2013-12-01 18:31:55 -05:00
|
|
|
it("can execute a template", function () {
|
|
|
|
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
|
|
|
});
|
|
|
|
});
|