mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 03:47:16 +08:00
Upgrade to ember-qunit
This commit is contained in:
@ -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 ); }
|
||||
|
Reference in New Issue
Block a user