diff options
Diffstat (limited to 'spec/blocks.js')
-rw-r--r-- | spec/blocks.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/blocks.js b/spec/blocks.js index 80f1580..3584ed7 100644 --- a/spec/blocks.js +++ b/spec/blocks.js @@ -65,6 +65,13 @@ describe('blocks', function() { shouldCompileTo(string, hash, 'Goodbye cruel sad OMG!'); }); + it('works with cached blocks', function() { + var template = CompilerContext.compile('{{#each person}}{{#with .}}{{first}} {{last}}{{/with}}{{/each}}', {data: false}); + + var result = template({person: [{first: 'Alan', last: 'Johnson'}, {first: 'Alan', last: 'Johnson'}]}); + equals(result, 'Alan JohnsonAlan Johnson'); + }); + describe('inverted sections', function() { it('inverted sections with unset value', function() { var string = '{{#goodbyes}}{{this}}{{/goodbyes}}{{^goodbyes}}Right On!{{/goodbyes}}'; |