Skip to content

Commit

Permalink
[BUGFIX beta] Removes this._environment guard
Browse files Browse the repository at this point in the history
Fixes emberjs#14029
Related to emberjs#14085
  • Loading branch information
duggiefresh committed Aug 29, 2016
1 parent 69cedc1 commit aadb2e0
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
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,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
Original file line number Diff line number Diff line change
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 aadb2e0

Please sign in to comment.