Upgrade to ember-qunit

This commit is contained in:
Robin Ward
2014-07-30 17:53:14 -04:00
parent d29157dab9
commit b6684e7168
15 changed files with 350 additions and 161 deletions

View File

@ -26,29 +26,6 @@ function integration(name, lifecycle) {
});
}
function testController(klass, model) {
// HAX until we get ES6 everywhere:
if (typeof klass === "string") {
var base = "discourse",
moduleName,
module;
// maybe a bit too hacky? (all of the "admin-*" controllers are in the "admin" directory)
if (klass.indexOf("admin") === 0) {
base = "admin";
}
moduleName = base + '/controllers/' + klass;
module = requirejs.entries[moduleName];
if (module) {
klass = require(moduleName, null, null, true).default;
}
}
return klass.create({model: model, container: Discourse.__container__});
}
function controllerFor(controller, model) {
controller = Discourse.__container__.lookup('controller:' + controller);
if (model) { controller.set('model', model ); }