Skip to content

Commit

Permalink
Adding test for #750
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Abril committed Apr 2, 2014
1 parent 4fc5f4c commit 1132353
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions view/mustache/mustache_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3570,4 +3570,28 @@ steal("can/model", "can/view/mustache", "can/test", function () {
map.attr('showPeople', true);
equal(ul.innerHTML, '<li>Curtis</li><li>Stan</li><li>David</li>', 'List got updated');
});

test('each with child objects (#750)', function() {
var list = new can.List([{
i: 0
}, {
i: 1
}, {
i: 2
}]);

var template = can.view.mustache('{{#each list}}{{i}}{{/each}}');

var frag = template({
list: list
});

var div = document.createElement('div');
div.appendChild(frag);

equal(div.innerHTML, '012');

list.pop();
equal(div.innerHTML, '01');
});
});

0 comments on commit 1132353

Please sign in to comment.