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( + '', + [ + {value: ['a', 'b', 'c']}, + {}, + { + list: '{{#each .}}{{> @partial-block}}{{/each}}' + } + ], + true, + ''); + }); + 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, ''); }); + it('should render nested partial blocks at different nesting levels', function() { + shouldCompileToWithPartials( + '', + [ + {value: 'success'}, + {}, + { + outer: '{{#> nested}}{{> @partial-block}}{{/nested}}{{> @partial-block}}', + nested: '{{> @partial-block}}' + } + ], + true, + ''); + }); + it('should render nested partial blocks at different nesting levels (twice)', function() { + shouldCompileToWithPartials( + '', + [ + {value: 'success'}, + {}, + { + outer: '{{#> nested}}{{> @partial-block}} {{> @partial-block}}{{/nested}}{{> @partial-block}}+{{> @partial-block}}', + nested: '{{> @partial-block}}' + } + ], + true, + ''); + }); + it('should render nested partial blocks (twice at each level)', function() { + shouldCompileToWithPartials( + '', + [ + {value: 'success'}, + {}, + { + outer: '{{#> nested}}{{> @partial-block}} {{> @partial-block}}{{/nested}}', + nested: '{{> @partial-block}}{{> @partial-block}}' + } + ], + true, + ''); + }); }); describe('inline partials', function() {