Skip to content

Instantly share code, notes, and snippets.

@klaaspieter
Created January 30, 2013 17:07
Show Gist options
  • Save klaaspieter/4674730 to your computer and use it in GitHub Desktop.
Save klaaspieter/4674730 to your computer and use it in GitHub Desktop.
test("#each accepts a name binding and does not change the context", function() {
var controller = Ember.Controller.create({
name: 'bob the controller'
}),
obj = Ember.Object.create({
name: 'henry the item'
});
view = Ember.View.create({
template: templateFor("{{#view}}{{#each item in view.items}}{{name}}{{/each}}{{/view}}"),
title: "My Cool Each Test",
items: Ember.A([obj]),
controller: controller
});
append(view);
equal(view.$().text(), "henry the item");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment