diff --git a/spec/partials.js b/spec/partials.js
index cbec5886..0434cbff 100644
--- a/spec/partials.js
+++ b/spec/partials.js
@@ -263,6 +263,32 @@ describe('partials', function() {
true,
'success');
});
+ it('should allow the #each-helper to be used along with partial-blocks', function() {
+ shouldCompileToWithPartials(
+ '{{#> list value}}value = {{.}}{{/list}}',
+ [
+ {value: ['a', 'b', 'c']},
+ {},
+ {
+ list: '{{#each .}}- {{> @partial-block}}
{{/each}}
'
+ }
+ ],
+ true,
+ '- value = a
- value = b
- value = c
');
+ });
+ it('should render block from partial with context (twice)', function() {
+ shouldCompileToWithPartials(
+ '{{#> dude}}{{value}}{{/dude}}',
+ [
+ {context: {value: 'success'}},
+ {},
+ {
+ dude: '{{#with context}}{{> @partial-block }} {{> @partial-block }}{{/with}}'
+ }
+ ],
+ true,
+ 'success success');
+ });
it('should render block from partial with context', function() {
shouldCompileToWithPartials(
'{{#> dude}}{{../context/value}}{{/dude}}',
@@ -291,6 +317,50 @@ describe('partials', function() {
true,
'success');
});
+ it('should render nested partial blocks at different nesting levels', function() {
+ shouldCompileToWithPartials(
+ '{{#> outer}}{{value}}{{/outer}}',
+ [
+ {value: 'success'},
+ {},
+ {
+ outer: '{{#> nested}}{{> @partial-block}}{{/nested}}{{> @partial-block}}',
+ nested: '{{> @partial-block}}'
+ }
+ ],
+ true,
+ 'successsuccess');
+ });
+ it('should render nested partial blocks at different nesting levels (twice)', function() {
+ shouldCompileToWithPartials(
+ '{{#> outer}}{{value}}{{/outer}}',
+ [
+ {value: 'success'},
+ {},
+ {
+ outer: '{{#> nested}}{{> @partial-block}} {{> @partial-block}}{{/nested}}{{> @partial-block}}+{{> @partial-block}}',
+ nested: '{{> @partial-block}}'
+ }
+ ],
+ true,
+ 'success successsuccess+success');
+ });
+ it('should render nested partial blocks (twice at each level)', function() {
+ shouldCompileToWithPartials(
+ '{{#> outer}}{{value}}{{/outer}}',
+ [
+ {value: 'success'},
+ {},
+ {
+ outer: '{{#> nested}}{{> @partial-block}} {{> @partial-block}}{{/nested}}',
+ nested: '{{> @partial-block}}{{> @partial-block}}'
+ }
+ ],
+ true,
+ '' +
+ 'success successsuccess success' +
+ '');
+ });
});
describe('inline partials', function() {