The controller I would like to test contains the following:
filterText: '',
filteredFoos: (Ember.A()),
filterFoosImpl: function() {
console.log('filterFoos begin' );
var filterText = this.get('filterText');
var filteredFoos = this.forEach(function(foo) {
return (foo.get(name).indexOf(filterText) >= 0);
});
this.set('filteredFoos', filteredFoos);
},
filterFoos: function() {
Ember.run.debounce(this.filterFoosImpl.bind(this), 300);
}.observes('model', 'filterText'),
Now I would like to write a test
that asserts that filteredFoos
is updated when I set filterText
.
To do this correctly, I will need to take into account Ember.run.debounce
,
and wait for that to occur before I perform my assertion.
How can I do this?