Created
January 10, 2011 17:35
-
-
Save gmoeck/773106 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 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