Created
March 10, 2015 20:22
-
-
Save walter/dcfbfc0b853a2a7f563b to your computer and use it in GitHub Desktop.
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('renderTemplate sets application.duringQuestionSteps to true', | |
function(assert) { | |
var route = this.subject(), | |
applicationController = route.controllerFor('application'), | |
didRender; | |
// http://discuss.emberjs.com/t/test-isolation-aka-how-wrong-am-i-doing-it/7162/2 | |
route.render = function mockRender(route) { | |
didRender = true; | |
}; | |
route.send('renderTemplate'); | |
assert.equal(applicationController.get('duringQuestionSteps'), true); | |
assert.ok(didRender, 'expected to render'); | |
}); |
Figured it out thanks to http://weichienhung.github.io/blog/2014/03/08/unit-testing-in-emberjs/.
Rather than do this:
route.send('renderTemplate');
I needed to do this:
route.renderTemplate();
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's what it is testing: