summaryrefslogtreecommitdiffstats
path: root/spec/builtins.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-10-14 21:36:46 -0500
committerkpdecker <kpdecker@gmail.com>2013-10-14 21:38:19 -0500
commit84049bf0c5576727e9d6a0880abb123454d28861 (patch)
tree20700bf7f047fe822a76363cd125599e18f4b228 /spec/builtins.js
parent2cd0995f2158371dc83590281839af9edca2c90a (diff)
downloadhandlebars.js-84049bf0c5576727e9d6a0880abb123454d28861.zip
handlebars.js-84049bf0c5576727e9d6a0880abb123454d28861.tar.gz
handlebars.js-84049bf0c5576727e9d6a0880abb123454d28861.tar.bz2
Add includeZero flag to if conditional
Allows for users who desire non-falsy handling of numbers to utilize if while maintaining the legacy if behavior. Fixes #608
Diffstat (limited to 'spec/builtins.js')
-rw-r--r--spec/builtins.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/builtins.js b/spec/builtins.js
index 140f5f5..401e789 100644
--- a/spec/builtins.js
+++ b/spec/builtins.js
@@ -15,8 +15,11 @@ describe('builtin helpers', function() {
"if with non-empty array shows the contents");
shouldCompileTo(string, {goodbye: [], world: "world"}, "cruel world!",
"if with empty array does not show the contents");
- shouldCompileTo(string, {goodbye: 0, world: "world"}, "GOODBYE cruel world!",
- "if with zero does show the contents");
+ shouldCompileTo(string, {goodbye: 0, world: "world"}, "cruel world!",
+ "if with zero does not show the contents");
+ shouldCompileTo("{{#if goodbye includeZero=true}}GOODBYE {{/if}}cruel {{world}}!",
+ {goodbye: 0, world: "world"}, "GOODBYE cruel world!",
+ "if with zero does not show the contents");
});
it("if with function argument", function() {