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
| Delegates to the store to create the record, expected: 1 result: 0 |
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({ | |
| countSummary: function() { | |
| var length = this.get('length'); | |
| if(length == 0) | |
| return 'No Tasks'; | |
| else | |
| return length == 1 ? '1 Task' : "%@ Tasks".fmt(length); | |
| }.property('length').cacheable(), |
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 'controller.addTask' [undefined] is not a function. |
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(); |
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: 'topView middleView bottomView'.w(), | |
| topView: SC.ToolbarView.design({ | |
| childViews: 'addTaskButton'.w(), | |
| addTaskButton: SC.ButtonView.design({ | |
| target: 'Todos.tasksController', //ADDED THIS | |
| action: 'addTask', //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
| it should add a task to the list, expected: 1 result: 0 |
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: 'topView middleView bottomView'.w(), //ADDED topView | |
| //ADDED THIS VIEW | |
| topView: SC.ToolbarView.design({ | |
| childViews: 'addTaskButton'.w(), | |
| addTaskButton: SC.ButtonView.design({ | |
| }) |
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 expresssion 'button' [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
| var initialLength; | |
| module("Given I am looking at the main page", { | |
| setup: function() { | |
| var tasks = Todos.store.find(Todos.Task); | |
| initialLength = tasks.length(); | |
| SC.RunLoop.begin(); | |
| Todos.main(); | |
| SC.RunLoop.end(); | |
| }, |
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
| countSummary: function() { | |
| var length = this.get('length'); | |
| if(length == 0) return 'No Tasks'; | |
| return length == 1 ? '1 Task' : "%@ Tasks".fmt(length); | |
| }.property('length').cacheable(), |