Skip to content

Commit

Permalink
Merge pull request #14079 from duggiefresh/14029-remove-environment-g…
Browse files Browse the repository at this point in the history
…uard

[BUGFIX beta] Removes `this._environment` guard
  • Loading branch information
rwjblue committed Sep 2, 2016
2 parents 8414c30 + aadb2e0 commit 63d9c84
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions packages/ember-application/tests/system/visit_test.js
Expand Up @@ -357,6 +357,23 @@ QUnit.test('visit() returns a promise that resolves without rendering when shoul
});
});

QUnit.test('visit() renders a template when shouldRender is set to true', function(assert) {
assert.expect(3);

run(() => {
createApplication();

App.register('template:application', compile('<h1>Hello world</h1>'));
});

assert.strictEqual(jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element');

return run(App, 'visit', '/', { shouldRender: true }).then(instance => {
assert.ok(instance instanceof ApplicationInstance, 'promise is resolved with an ApplicationInstance');
assert.strictEqual(jQuery('#qunit-fixture').children().length, 1, 'there is 1 element in the fixture element after visit');
});
});

QUnit.test('visit() returns a promise that resolves without rendering when shouldRender is set to false with Engines', function(assert) {
assert.expect(3);

Expand Down
2 changes: 1 addition & 1 deletion packages/ember-routing/lib/system/route.js
Expand Up @@ -1264,7 +1264,7 @@ let Route = EmberObject.extend(ActionHandler, Evented, {

this.setupController(controller, context, transition);

if (!this._environment || this._environment.options.shouldRender) {
if (this._environment.options.shouldRender) {
this.renderTemplate(controller, context);
}
},
Expand Down

0 comments on commit 63d9c84

Please sign in to comment.