Skip to content

Commit

Permalink
[BUGFIX release] Fix #13670 reconnecting an empty outlet.
Browse files Browse the repository at this point in the history
Add failing test for #13670 and fix render options shaping to fix isStable.
  • Loading branch information
krisselden committed Jun 15, 2016
1 parent d801dc3 commit 00e5e0b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/ember-routing/lib/system/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -2030,9 +2030,13 @@ var Route = EmberObject.extend(ActionHandler, Evented, {
// into its outlets, which won't render anywhere. All of this
// statefulness should get the machete in 2.0.
this.connections[i] = {
owner: connection.owner,
into: connection.into,
outlet: connection.outlet,
name: connection.name
name: connection.name,
controller: undefined,
template: undefined,
ViewClass: undefined
};
run.once(this.router, '_setOutlets');
}
Expand Down Expand Up @@ -2130,7 +2134,8 @@ function buildRenderOptions(route, namePassed, isDefaultRender, _name, options)
outlet,
name,
controller,
template: template || route._topLevelViewTemplate
template: template || route._topLevelViewTemplate,
ViewClass: undefined
};

assert(`Could not find "${name}" template, view, or component.`, isDefaultRender || template);
Expand Down
8 changes: 8 additions & 0 deletions packages/ember/tests/routing/basic_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2439,6 +2439,14 @@ test('Route supports clearing outlet explicitly', function() {
router.send('hideExtra');
});
equal(jQuery('div.posts-extra:contains(postsExtra)', '#qunit-fixture').length, 0, 'The posts/extra template was removed');
run(function() {
router.send('showModal');
});
equal(jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 1, 'The posts/modal template was rendered');
run(function() {
router.send('showExtra');
});
equal(jQuery('div.posts-extra:contains(postsExtra)', '#qunit-fixture').length, 1, 'The posts/extra template was rendered');

handleURL('/users');

Expand Down

0 comments on commit 00e5e0b

Please sign in to comment.