Created
January 10, 2011 17:36
-
-
Save gmoeck/773107 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}); | |
//ADDED THIS TEST | |
test("#countSummary - when there is one task", function() { | |
stubbedFunction = controller.get; | |
controller.get = CoreTest.stub('length', {action: function() { return 1;} }); | |
equals(controller.countSummary(), '1 Task', 'returns "1 Task"'); | |
controller.get = stubbedFunction; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment