-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the correct owner for each template lookup.
Ensure that the owner being used is not the environments default `Owner`, but it is the owner that the template is being looked up by. For late bound templates this means the components owner, and for normal templates (looked up from registry) it is passed to the factories `.create` method by the container itself.
- Loading branch information
Robert Jackson
committed
Aug 27, 2016
1 parent
447df33
commit 02814c2
Showing
8 changed files
with
92 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
packages/ember-glimmer/tests/integration/application/engine-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import packageName from '../../utils/package-name'; | ||
import { moduleFor, ApplicationTest } from '../../utils/test-case'; | ||
import { strip } from '../../utils/abstract-test-case'; | ||
import { compile } from '../../utils/helpers'; | ||
import Controller from 'ember-runtime/controllers/controller'; | ||
import Engine from 'ember-application/system/engine'; | ||
import isEnabled from 'ember-metal/features'; | ||
|
||
// only run these tests for ember-glimmer when the feature is enabled, or for | ||
// ember-htmlbars when the feature is not enabled | ||
const shouldRun = isEnabled('ember-application-engines') && ( | ||
( | ||
(isEnabled('ember-glimmer') && packageName === 'glimmer') || | ||
(!isEnabled('ember-glimmer') && packageName === 'htmlbars') | ||
) | ||
); | ||
|
||
if (shouldRun) { | ||
moduleFor('Application test: engine rendering', class extends ApplicationTest { | ||
['@test sharing a template between engine and application has separate refinements']() { | ||
this.assert.expect(1); | ||
|
||
let sharedTemplate = compile(strip` | ||
<h1>{{contextType}}</h1> | ||
{{ambiguous-curlies}} | ||
{{outlet}} | ||
`); | ||
|
||
this.application.register('template:application', sharedTemplate); | ||
this.registerController('application', Controller.extend({ | ||
contextType: 'Application', | ||
'ambiguous-curlies': 'Controller Data!' | ||
})); | ||
|
||
this.router.map(function() { | ||
this.mount('blog'); | ||
}); | ||
this.application.register('route-map:blog', function() { }); | ||
|
||
this.registerEngine('blog', Engine.extend({ | ||
init() { | ||
this._super(...arguments); | ||
|
||
this.register('controller:application', Controller.extend({ | ||
contextType: 'Engine' | ||
})); | ||
this.register('template:application', sharedTemplate); | ||
this.register('template:components/ambiguous-curlies', compile(strip` | ||
<p>Component!</p> | ||
`)); | ||
} | ||
})); | ||
|
||
return this.visit('/blog').then(() => { | ||
this.assertText('ApplicationController Data!EngineComponent!'); | ||
}); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters