Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Commit

Permalink
Add tests for issue #770
Browse files Browse the repository at this point in the history
  • Loading branch information
estark37 authored and Stephen Darnell committed Apr 7, 2013
1 parent 2987ff0 commit 7ded24d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/templating/templating_tests.html
Expand Up @@ -355,3 +355,11 @@
<template name="test_template_issue801">
{{#each values}}{{this}}{{/each}}
</template>

<!-- Test for issue #770 - falsy value for with -->
<template name="test_template_issue770">
{{# with value1}}{{this}}{{else}}xxx{{/with}}
{{# with value2}}{{this}}{{else}}xxx{{/with}}
{{# with value1}}{{this}}{{/with}}
{{# with value2}}{{this}}{{/with}}
</template>
7 changes: 7 additions & 0 deletions packages/templating/templating_tests.js
Expand Up @@ -1092,3 +1092,10 @@ Tinytest.add('templating - each falsy Issue #801', function (test) {
var frag = Meteor.render(Template.test_template_issue801);
test.equal(canonicalizeHtml(DomUtils.fragmentToHtml(frag)), "12null");
});

Tinytest.add('templating - with falsy Issue #770', function (test) {
Template.test_template_issue770.value1 = function () { return "abc"; };
Template.test_template_issue770.value2 = function () { return false; };
var frag = Meteor.render(Template.test_template_issue770);
test.equal(canonicalizeHtml(DomUtils.fragmentToHtml(frag)), "abcxxxabc");
});

0 comments on commit 7ded24d

Please sign in to comment.