Skip to content

Commit

Permalink
Fix #239
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 committed Apr 10, 2015
1 parent 47408b6 commit 8fcefd0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addon/ember-internals.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export var OutletBehavior = {


setOutletState: function(state) {
if (state.render && state.render.controller && !state._lf_model) {
if (state && state.render && state.render.controller && !state._lf_model) {
// This is a hack to compensate for Ember 1.0's remaining use of
// mutability within the route state -- the controller is a
// singleton whose model will keep changing on us. By locking it
Expand Down
20 changes: 20 additions & 0 deletions tests/integration/helpers/liquid-outlet-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,23 @@ QUnit.skip('can see model-to-model transitions on the same route', function(asse
assert.equal(this.$('.content').text().trim(), '2');
assert.ok(tmap.transitionFor.called, 'transitionFor called');
});

test('tolerates empty content when parent outlet is stable', function(assert) {
this.render('A{{liquid-outlet}}B');

var state = {
render: {
template: Ember.Handlebars.compile('C{{liquid-outlet "a"}}D{{liquid-outlet "b"}}E')
},
outlets: {}
};

setOutletState(state);
assert.equal(this.$().text().trim(), 'ACDEB');
state.outlets.a = {
render: { template: Ember.Handlebars.compile('foo') },
outlets: {}
};
setOutletState(state);
assert.equal(this.$().text().trim(), 'ACfooDEB');
});

0 comments on commit 8fcefd0

Please sign in to comment.