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('ul', function() {
|
11 | return describe('{{#ul list class="list"}} \n\
|
12 | {{this}} \n\
|
13 | {{/ul}}', function() {
|
14 | return it('should create an unordered list.', function() {
|
15 | var context, source, template;
|
16 |
|
17 | source = '{{#ul list class="list"}}{{this}}{{/ul}}';
|
18 | template = Handlebars.compile(source);
|
19 | context = {
|
20 | list: ['one']
|
21 | };
|
22 | return template(context).should.equal('<ul class="list"><li>one</li></ul>');
|
23 | });
|
24 | });
|
25 | });
|
26 |
|
27 | describe('ol', function() {
|
28 | return describe('{{#ol list class="list"}} \n\
|
29 | {{this}} \n\
|
30 | {{/ol}}', function() {
|
31 | return it('should create an ordered list.', function() {
|
32 | var context, source, template;
|
33 |
|
34 | source = '{{#ol list class="list"}}{{this}}{{/ol}}';
|
35 | template = Handlebars.compile(source);
|
36 | context = {
|
37 | list: ['boom']
|
38 | };
|
39 | return template(context).should.equal('<ol class="list"><li>boom</li></ol>');
|
40 | });
|
41 | });
|
42 | });
|
43 |
|
44 | describe('br', function() {
|
45 | return describe('{{br 4}}', function() {
|
46 | return it('should return <br> tags based on a count.', function() {
|
47 | var source, template;
|
48 |
|
49 | source = '{{br 4}}';
|
50 | template = Handlebars.compile(source);
|
51 | return template(context).should.equal('<br><br><br><br>');
|
52 | });
|
53 | });
|
54 | });
|
55 |
|
56 | }).call(this);
|