Skip to content

Commit

Permalink
[BUGFIX beta] Pass environment options forward to Engines
Browse files Browse the repository at this point in the history
This fixes a failing test introduced in the previous test where Engines
rendered even though shouldRender was set to false.
  • Loading branch information
Trent Willis committed Aug 4, 2016
1 parent 47c6a6f commit d2d6e27
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/ember-application/lib/system/engine-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,12 @@ if (isEnabled('ember-application-engines')) {
[
'router:main',
P`-bucket-cache:main`,
'-view-registry:main'
'-view-registry:main',
'-environment:main'
].forEach(key => this.register(key, parent.lookup(key), { instantiate: false }));

this.inject('view', '_environment', '-environment:main');
this.inject('route', '_environment', '-environment:main');
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ QUnit.test('unregistering a factory clears all cached instances of that factory'

if (isEnabled('ember-application-engines')) {
QUnit.test('can build and boot a registered engine', function(assert) {
assert.expect(7);
assert.expect(8);

let ChatEngine = Engine.extend();
let chatEngineInstance;
Expand All @@ -150,6 +150,7 @@ if (isEnabled('ember-application-engines')) {

run(() => {
appInstance = ApplicationInstance.create({ application });
appInstance.setupRegistry();
chatEngineInstance = appInstance.buildChildEngineInstance('chat');
});

Expand All @@ -171,7 +172,8 @@ if (isEnabled('ember-application-engines')) {
[
'router:main',
P`-bucket-cache:main`,
'-view-registry:main'
'-view-registry:main',
'-environment:main'
].forEach(key => {
assert.strictEqual(
chatEngineInstance.lookup(key),
Expand Down
1 change: 1 addition & 0 deletions packages/ember-htmlbars/tests/integration/mount_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function commonSetup() {
app.register('component-lookup:main', ComponentLookup);

appInstance = app.buildInstance();
appInstance.setupRegistry();
});
}

Expand Down

0 comments on commit d2d6e27

Please sign in to comment.