diff options
author | kpdecker <kpdecker@gmail.com> | 2013-10-14 21:36:46 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2013-10-14 21:38:19 -0500 |
commit | 84049bf0c5576727e9d6a0880abb123454d28861 (patch) | |
tree | 20700bf7f047fe822a76363cd125599e18f4b228 /spec/builtins.js | |
parent | 2cd0995f2158371dc83590281839af9edca2c90a (diff) | |
download | handlebars.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.js | 7 |
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() { |