This file contains 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
this.resource('contract', {path: '/contract'}, function() { | |
this.route('edit', {path: ':contract_id/edit'}); | |
this.route('show', {path: ':contract_id'}); | |
}); |
This file contains 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.RSVP.configure('onerror', function(e) { | |
console.log(e.message); | |
console.log(e.stack); | |
}); |
This file contains 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
functionThatReturnsPromise.then(function() { | |
console.log('about to do some logic'); | |
this.get('controllers.application.currentUser').reload(); | |
console.log('Why won\'t my code get to this point????'); | |
}); |
This file contains 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
describe "mocked query of web service" do | |
it "should perform correct action on system data based on mocked response" do | |
RestClient = double | |
file = File.open('RELATIVE_FILE_PATH_HERE', 'r') #Relative to root of Rails app | |
data = file.read | |
file.close | |
response = double | |
response.stub(:code) { 200 } | |
response.stub(:body) { data } |
This file contains 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.get('currentPath'); |
This file contains 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 = Ember,Application.create({ | |
currentPath: '' | |
}); | |
ApplicationController : Ember.Controller.extend({ | |
currentPathDidChange: function() { | |
App.set('currentPath', this.get('currentPath')); | |
}.observes('currentPath') | |
}); |
This file contains 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 editing of a book updates search results", function() { | |
expect(7); | |
visit("/").then(function() { | |
return click("#searchButton"); //Click the search button | |
}).then(function() { | |
throws( | |
function() { | |
find(".searchResult h2:contains('The Great Modification')") ; |
This file contains 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"); |
This file contains 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 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() { |