summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn M Moore <code@sartak.org>2012-10-05 16:07:55 -0400
committerShawn M Moore <code@sartak.org>2012-10-05 16:08:27 -0400
commitdc22175fdfdc9a100cfc8e72efc6e6f7573835a1 (patch)
tree588c72ca2fd6ce004e3c192e1c3c6e62359272fd
parent70d3df4d85c9a8fb3ac2c2a3cdb4c579e8ee5efc (diff)
downloadtext-handlebars-dc22175fdfdc9a100cfc8e72efc6e6f7573835a1.tar.gz
text-handlebars-dc22175fdfdc9a100cfc8e72efc6e6f7573835a1.zip
Another test for "each" setting up context correctly
-rw-r--r--t/block-helper-builtins.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/block-helper-builtins.t b/t/block-helper-builtins.t
index fe1763b..c891b89 100644
--- a/t/block-helper-builtins.t
+++ b/t/block-helper-builtins.t
@@ -59,6 +59,31 @@ RENDERED
render_ok(
<<'TEMPLATE',
+<ul class="people_list">
+ {{#each people}}
+ <li>{{last}}, {{first}}</li>
+ {{/each}}
+</ul>
+TEMPLATE
+ {
+ people => [
+ { first => "Yehuda", last => "Katz" },
+ { first => "Alan", last => "Johnson" },
+ { first => "Charles", last => "Jolley" },
+ ],
+ },
+ <<'RENDERED',
+<ul class="people_list">
+ <li>Katz, Yehuda</li>
+ <li>Johnson, Alan</li>
+ <li>Jolley, Charles</li>
+</ul>
+RENDERED
+ "each helper"
+);
+
+render_ok(
+ <<'TEMPLATE',
<div class="entry">
{{#if author}}
<h1>{{firstName}} {{lastName}}</h1>