summaryrefslogtreecommitdiffstats
path: root/spec/partials.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/partials.js')
-rw-r--r--spec/partials.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/partials.js b/spec/partials.js
index b2fc9e0..a9cd3dd 100644
--- a/spec/partials.js
+++ b/spec/partials.js
@@ -238,6 +238,12 @@ describe('partials', function() {
var hash = {root: 'yes', dudes: [{name: 'Yehuda', url: 'http://yehuda'}, {name: 'Alan', url: 'http://alan'}]};
shouldCompileToWithPartials(string, [hash, {}, {dude: partial}, true], true, 'Dudes: Yehuda (http://yehuda) yes Alan (http://alan) yes ');
});
+ it('partials can access parents with custom context', function() {
+ var string = 'Dudes: {{#dudes}}{{> dude "test"}}{{/dudes}}';
+ var partial = '{{name}} ({{url}}) {{root}} ';
+ var hash = {root: 'yes', dudes: [{name: 'Yehuda', url: 'http://yehuda'}, {name: 'Alan', url: 'http://alan'}]};
+ shouldCompileToWithPartials(string, [hash, {}, {dude: partial}, true], true, 'Dudes: Yehuda (http://yehuda) yes Alan (http://alan) yes ');
+ });
it('partials can access parents without data', function() {
var string = 'Dudes: {{#dudes}}{{> dude}}{{/dudes}}';
var partial = '{{name}} ({{url}}) {{root}} ';