mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
Update code so Ember 2.3 can have more tests passing
This commit is contained in:
parent
78cd42943f
commit
151597bf0f
5 changed files with 46 additions and 20 deletions
|
@ -36,10 +36,24 @@ export default function(name, opts) {
|
|||
this.registry.register('store:main', store, { instantiate: false });
|
||||
|
||||
if (opts.setup) {
|
||||
if (Ember.VERSION[0] === "2") {
|
||||
// use closure actions instead
|
||||
this.on = (actionName, fn) => this.set(actionName, fn);
|
||||
}
|
||||
|
||||
opts.setup.call(this, store);
|
||||
}
|
||||
|
||||
andThen(() => this.render(opts.template));
|
||||
andThen(() => {
|
||||
// TODO: This shouldn't be necessary
|
||||
this.owner = {
|
||||
hasRegistration: (...args) => this.registry.has(...args),
|
||||
lookup: (...args) => this.container.lookup(...args),
|
||||
_lookupFactory: (...args) => this.container.lookupFactory(...args)
|
||||
};
|
||||
|
||||
return this.render(opts.template);
|
||||
});
|
||||
andThen(() => opts.test.call(this, assert));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue