summaryrefslogtreecommitdiffstats
path: root/spec/qunit_spec.js
diff options
context:
space:
mode:
authorAlan Johnson <alan@commondream.net>2011-06-27 03:15:50 -0700
committerAlan Johnson <alan@commondream.net>2011-06-27 03:15:50 -0700
commit37e36bf1371f458212db7ee45a18ed163cd329fb (patch)
treeda90f35d712b0943a37bc918e92a60d4f8d364a3 /spec/qunit_spec.js
parent3c2086eb2a501604c490608123c24fa3c0d25264 (diff)
parentdec196b4d913cde7b5e6030ca62fc3f3457ca642 (diff)
downloadhandlebars.js-37e36bf1371f458212db7ee45a18ed163cd329fb.zip
handlebars.js-37e36bf1371f458212db7ee45a18ed163cd329fb.tar.gz
handlebars.js-37e36bf1371f458212db7ee45a18ed163cd329fb.tar.bz2
Merge pull request #66 from rgrove/fix-empty-array-if
The "if" block helper shouldn't treat empty arrays as truthy
Diffstat (limited to 'spec/qunit_spec.js')
-rw-r--r--spec/qunit_spec.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/qunit_spec.js b/spec/qunit_spec.js
index 65100e0..56cb687 100644
--- a/spec/qunit_spec.js
+++ b/spec/qunit_spec.js
@@ -518,6 +518,10 @@ test("if", function() {
"if with boolean argument does not show the contents when false");
shouldCompileTo(string, {world: "world"}, "cruel world!",
"if with undefined does not show the contents");
+ shouldCompileTo(string, {goodbye: ['foo'], world: "world"}, "GOODBYE cruel world!",
+ "if with non-empty array shows the contents");
+ shouldCompileTo(string, {goodbye: [], world: "world"}, "cruel world!",
+ "if with empty array does not show the contents");
});
test("each", function() {