Skip to content

Instantly share code, notes, and snippets.

@gmoeck
Created January 10, 2011 16:18
Show Gist options
  • Save gmoeck/772970 to your computer and use it in GitHub Desktop.
Save gmoeck/772970 to your computer and use it in GitHub Desktop.
var mockedFindFunction, findMockObject;
module("Todos.main", {
setup: function() {
mockedFindFunction = Todos.store.find;
findMockObject = CoreTest.stub('Todos.store.find', function() { return YES; });
Todos.store.find = findMockObject;
},
teardown: function() {
Todos.store.find = mockedFindFunction;
}
});
test("setup finding tasks", function() {
Todos.main();
equals(setMockObject.callCount, 1, "Should delegate to the store to find the tasks");
Todos.getPath('mainPage.mainPane').remove();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment