Commit 0d9158b2 authored by Addy Osmani's avatar Addy Osmani

Merge pull request #841 from NeilvB/controller-test-fix

Fake model now executes callback on getCount. Fixes failing tests.
parents a96ded27 14f5dba0
......@@ -11,7 +11,9 @@ describe('controller', function () {
callback(todos);
});
model.getCount.andReturn({
model.getCount.andCallFake(function (callback) {
var todoCounts = {
active: todos.filter(function (todo) {
return !todo.completed;
}).length,
......@@ -19,6 +21,9 @@ describe('controller', function () {
return !!todo.completed;
}).length,
total: todos.length
};
callback(todoCounts);
});
model.remove.andCallFake(function (id, callback) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment