UNPKG

1.03 kBJavaScriptView Raw
1(function() {
2 var Assemble, Handlebars;
3
4 require('should');
5
6 Handlebars = require('handlebars');
7
8 Assemble = require('../lib/helpers-lib');
9
10 describe('default', function() {
11 return describe('{{default title "Not title available."}}', function() {
12 return it('should provide a default or fallback value if a value doesn\'t exist.', function() {
13 var context, source, template;
14
15 source = '{{default title "No title available."}}';
16 template = Handlebars.compile(source);
17 context = {
18 title: null
19 };
20 return template(context).should.equal('No title available.');
21 });
22 });
23 });
24
25 /*
26 Assemble.Config.partialsPath = '../test/templates/'
27
28 describe 'partial', ->
29 describe '{{partial "some_template"}}', ->
30 it 'should register and render a partial.', ->
31 source = '{{partial "some_template"}}'
32 template = Handlebars.compile(source)
33
34 template().should.equal 'A partial.'
35 */
36
37
38}).call(this);