Upgrade ember qunit, create new interface for testing components

This commit is contained in:
Robin Ward
2015-07-14 13:56:59 -04:00
parent 1397507d05
commit 7a58d64f37
7 changed files with 162 additions and 146 deletions

View File

@ -0,0 +1,22 @@
import createStore from 'helpers/create-store';
export default function(name, opts) {
opts = opts || {};
test(name, function(assert) {
if (opts.setup) {
const store = createStore();
opts.setup.call(this, store);
}
this.container.register('site-settings:main', Discourse.SiteSettings, { instantiate: false });
this.container.injection('component', 'siteSettings', 'site-settings:main');
andThen(() => {
this.render(opts.template);
});
andThen(() => {
opts.test.call(this, assert);
});
});
}