summaryrefslogtreecommitdiffstats
path: root/spec/qunit_spec.js
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2012-12-23 21:27:04 -0800
committerYehuda Katz <wycats@gmail.com>2012-12-23 21:27:44 -0800
commit02d35262f9b6880413be98f3085a74ab362a61e4 (patch)
treefac545cf91d5485d7be9cf3ac55a38c8dd245038 /spec/qunit_spec.js
parent8df848894749b3fabc2793166ea492a822be9580 (diff)
downloadhandlebars.js-02d35262f9b6880413be98f3085a74ab362a61e4.zip
handlebars.js-02d35262f9b6880413be98f3085a74ab362a61e4.tar.gz
handlebars.js-02d35262f9b6880413be98f3085a74ab362a61e4.tar.bz2
Fill in missing specs
Diffstat (limited to 'spec/qunit_spec.js')
-rw-r--r--spec/qunit_spec.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/qunit_spec.js b/spec/qunit_spec.js
index 6e52865..5203cfc 100644
--- a/spec/qunit_spec.js
+++ b/spec/qunit_spec.js
@@ -456,12 +456,17 @@ test("providing a helpers hash", function() {
"Goodbye cruel world!", "helpers hash is available inside other blocks");
});
-test("in cases of conflict, the explicit hash wins", function() {
-
+test("in cases of conflict, helpers win", function() {
+ shouldCompileTo("{{{lookup}}}", [{lookup: 'Explicit'}, {lookup: function() { return 'helpers'; }}], "helpers",
+ "helpers hash has precedence escaped expansion");
+ shouldCompileTo("{{lookup}}", [{lookup: 'Explicit'}, {lookup: function() { return 'helpers'; }}], "helpers",
+ "helpers hash has precedence simple expansion");
});
test("the helpers hash is available is nested contexts", function() {
-
+ shouldCompileTo("{{#outer}}{{#inner}}{{helper}}{{/inner}}{{/outer}}",
+ [{'outer': {'inner': {'unused':[]}}}, {'helper': function() { return 'helper'; }}], "helper",
+ "helpers hash is available in nested contexts.");
});
suite("partials");