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
| ember_template_name_proc = proc { |input| | |
| dir = File.dirname(input.path) | |
| dir = dir.sub!('templates/', '') | |
| template_name = File.basename(input.path, File.extname(input.path)) | |
| template_name = dir + '/' + template_name if !dir.nil? | |
| template_name | |
| } |
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
| App.CategoriesRoute = Ember.Route.extend({ | |
| model: function() { | |
| return App.Category.find(); | |
| } | |
| }); |
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
| {{#each model}} | |
| //List all categories here | |
| {{/each}} | |
| {{#each filteredCategories}} | |
| //List filtered categories here | |
| {{/each}} |
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
| App.CategoriesController = Ember.Array.extend({ | |
| filteredCategories: function() { | |
| var filter = 'String value to compare lower case name to. '; | |
| return this.get('model').filterProperty('nameLowerCase', filter); | |
| }.property('[email protected]') | |
| }); |
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
| App.Category = Ember.Object.extend({ | |
| name: '', | |
| nameLowerCase: function() { | |
| return this.get('name').toLowerCase(); | |
| }.property('name') | |
| }); |
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
| IN .h | |
| @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; | |
| // This is an optional property from MKAnnotation | |
| @property (nonatomic, copy) NSString *title; | |
| IN .m | |
| @synthesize coordinate, title; |
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
| rails g qunit:install |
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
| //= require application | |
| //= require_tree . | |
| //= require_self | |
| document.write('<div id="ember-testing-container"><div id="ember-testing"></div></div>'); | |
| document.write('<style>#ember-testing-container { position: absolute; background: white; bottom: 0; right: 0; width: 640px; height: 384px; overflow: auto; z-index: 9999; border: 1px solid #ccc; } #ember-testing { zoom: 50%; }</style>'); | |
| App.rootElement = '#ember-testing'; | |
| App.setupForTesting(); | |
| App.injectTestHelpers(); |
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
| module("Ember.js Library", { | |
| setup: function() { | |
| Ember.run(App, App.advanceReadiness); | |
| }, | |
| teardown: function() { | |
| App.reset(); | |
| } | |
| }); | |
| test("Check HTML is returned", 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
| test("Check retrieval of books", function() { | |
| expect(6); | |
| visit("/").then(function() { | |
| ok(exists(".navBar"), "The navbar was rendered"); | |
| ok(exists("#searchButton"), "SearchButton was found"); | |
| }); | |
| visit("/").then(function() { | |
| return click("#searchButton"); |