Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX beta] Removes this._environment guard #14079

Merged
merged 1 commit into from Sep 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/ember-application/tests/system/visit_test.js
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
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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woooooo

this.renderTemplate(controller, context);
}
},
Expand Down