summaryrefslogtreecommitdiffstats
path: root/spec/qunit_spec.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-05-30 15:46:00 -0400
committerkpdecker <kpdecker@gmail.com>2013-05-30 15:47:30 -0400
commitd7b345b2da5436cd3199d9b9fcf51f0af49da77c (patch)
tree46e38000c1556eb4d3394f6685837e4f43f8af32 /spec/qunit_spec.js
parent17659b972070ee081987c410f1dbbf569a41f2e1 (diff)
downloadhandlebars.js-d7b345b2da5436cd3199d9b9fcf51f0af49da77c.zip
handlebars.js-d7b345b2da5436cd3199d9b9fcf51f0af49da77c.tar.gz
handlebars.js-d7b345b2da5436cd3199d9b9fcf51f0af49da77c.tar.bz2
Allow execution of helpers on the context
Fixes #285
Diffstat (limited to 'spec/qunit_spec.js')
-rw-r--r--spec/qunit_spec.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/qunit_spec.js b/spec/qunit_spec.js
index 317841f..14dbee7 100644
--- a/spec/qunit_spec.js
+++ b/spec/qunit_spec.js
@@ -165,6 +165,14 @@ test("functions", function() {
"functions are bound to the context");
});
+test("functions with context argument", function() {
+ shouldCompileTo("{{awesome frank}}",
+ {awesome: function(context) { return context; },
+ frank: "Frank"},
+ "Frank", "functions are called with context arguments");
+});
+
+
test("paths with hyphens", function() {
shouldCompileTo("{{foo-bar}}", {"foo-bar": "baz"}, "baz", "Paths can contain hyphens (-)");
shouldCompileTo("{{foo.foo-bar}}", {foo: {"foo-bar": "baz"}}, "baz", "Paths can contain hyphens (-)");