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
| Todos.mainPage = SC.Page.design({ | |
| mainPane: SC.MainPane.design({ | |
| childViews: 'middleView'.w(), | |
| middleView: SC.ScrollView.design({ | |
| childViews: 'contentView'.w(), | |
| contentView: SC.ListView.design({ | |
| contentBinding: 'Todos.tasksController.arrangedObjects' //ADDED THIS | |
| }) |
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
| Todos.tasksController = SC.ArrayController.create({ | |
| }) ; |
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
| Then I should see the task in the list, expected: true result: false |
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 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; |
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
| Todos.main = function main() { | |
| Todos.getPath('mainPage.mainPane').append() ; | |
| var tasks = Todos.store.find(Todos.Task); //ADDED THIS | |
| } ; | |
| function main() { Todos.main(); } |
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 mockedSetFunction, mockedFindFunction, setMockObject, findMockObject; | |
| module("Todos.main", { | |
| setup: function() { | |
| mockedSetFunction = Todos.tasksController.set; //ADDED THIS | |
| setMockObject = CoreTest.stub('Todos.tasksController.set', function() { return YES; }); //ADDED THIS | |
| Todos.tasksController.set = setMockObject; //ADDED THIS | |
| mockedFindFunction = Todos.store.find; | |
| findMockObject = CoreTest.stub('Todos.store.find', function() { return YES; }); | |
| Todos.store.find = findMockObject; |
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
| Todos.main = function main() { | |
| Todos.getPath('mainPage.mainPane').append() ; | |
| var tasks = Todos.store.find(Todos.Task); | |
| Todos.tasksController.set('content', tasks); //ADDED THIS | |
| }; | |
| function main() { Todos.main(); } |
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; | |
| module("Given I am viewing the tasks page", { | |
| setup: function() { | |
| SC.RunLoop.begin(); | |
| Todos.main(); | |
| SC.RunLoop.end(); | |
| }, | |
| teardown: function() { | |
| SC.RunLoop.begin(); |
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
| Died on test #1: TypeError: Result of expression 'summaryView' [undefined] is not an object. |
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
| Todos.mainPage = SC.Page.design({ | |
| mainPane: SC.MainPane.design({ | |
| childViews: 'middleView'.w(), | |
| middleView: SC.ScrollView.design({ | |
| hasHorizontalScroller: NO, //ADDED THIS | |
| layout: { top: 36, bottom: 32, left: 0, right: 0 }, //ADDED THIS | |
| backgroundColor: 'white', //ADDED THIS | |
| childViews: 'contentView'.w(), |