Skip to content

Instantly share code, notes, and snippets.

@gmoeck
Created January 10, 2011 17:14
Show Gist options
  • Save gmoeck/773072 to your computer and use it in GitHub Desktop.
Save gmoeck/773072 to your computer and use it in GitHub Desktop.
var controller, stubbedFunction;
module("Todos.tasksController", {
setup: function() {
controller = Todos.tasksController;
},
teardown: function() {
SC.RunLoop.begin();
Todos.store.reset();
SC.RunLoop.end();
}
});
test("#countSummary - when there are no tasks", function() {
stubbedFunction = controller.get;
controller.get = CoreTest.stub('length', {action: function() { return 0;} });
equals(controller.countSummary(), 'No Tasks', 'returns "No Tasks"');
controller.get = stubbedFunction;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment