Skip to content

Instantly share code, notes, and snippets.

@walter
Created March 10, 2015 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walter/dcfbfc0b853a2a7f563b to your computer and use it in GitHub Desktop.
Save walter/dcfbfc0b853a2a7f563b to your computer and use it in GitHub Desktop.
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');
});
@walter
Copy link
Author

walter commented Mar 10, 2015

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