Skip to content

Instantly share code, notes, and snippets.

@gmoeck
Created January 10, 2011 17:35
Show Gist options
  • Save gmoeck/773106 to your computer and use it in GitHub Desktop.
Save gmoeck/773106 to your computer and use it in GitHub Desktop.
var task, summaryView;
module("Given I am viewing the tasks page", {
setup: function() {
SC.RunLoop.begin();
Todos.main();
SC.RunLoop.end();
summaryView = Todos.getPath('mainPage.mainPane.bottomView.summaryView'); //EXTRACTED THIS TO HERE
},
teardown: function() {
SC.RunLoop.begin();
Todos.getPath('mainPage.mainPane').remove();
Todos.store.reset();
SC.RunLoop.end();
}
});
test("When there are no tasks inputted", function() {
equals(summaryView.get('value'), 'No Tasks', 'Then I should see "No Tasks" within the tasks count section of the page');
});
//ADDED THIS TEST
test("When there is one task already inputted", function() {
SC.RunLoop.begin();
Todos.store.createRecord(Todos.Task, {'description': 'Some Task', 'isDone': false });
SC.RunLoop.end();
equals(summaryView.get('value'), '1 Task', 'Then I should see "1 Task" within the tasks count section of the page');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment