Commit 14f5dba0 authored by Neil van Beinum's avatar Neil van Beinum

Fake model now executes callback on getCount. Fixes failing tests.

parent a96ded27
......@@ -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