DEV: Remove some extra Discourse.Site uses

This commit is contained in:
Robin Ward 2019-11-13 16:00:58 -05:00
parent bc2067898e
commit a4b89f8187
3 changed files with 7 additions and 4 deletions

View File

@ -3,6 +3,7 @@ import createStore from "helpers/create-store";
import { autoLoadModules } from "discourse/initializers/auto-load-modules";
import TopicTrackingState from "discourse/models/topic-tracking-state";
import User from "discourse/models/user";
import Site from "discourse/models/site";
export default function(name, opts) {
opts = opts || {};
@ -12,7 +13,7 @@ export default function(name, opts) {
}
test(name, function(assert) {
this.site = Discourse.Site.current();
this.site = Site.current();
this.registry.register("site-settings:main", Discourse.SiteSettings, {
instantiate: false

View File

@ -2,6 +2,7 @@ import { run } from "@ember/runloop";
import createStore from "helpers/create-store";
import NavItem from "discourse/models/nav-item";
import Category from "discourse/models/category";
import Site from "discourse/models/site";
QUnit.module("NavItem", {
beforeEach() {
@ -10,7 +11,7 @@ QUnit.module("NavItem", {
name: "确实是这样",
id: 343434
});
Discourse.Site.currentProp("categories").addObject(asianCategory);
Site.currentProp("categories").addObject(asianCategory);
});
}
});

View File

@ -1,13 +1,14 @@
import createStore from "helpers/create-store";
import Site from "discourse/models/site";
QUnit.module("model:site");
QUnit.test("create", assert => {
assert.ok(Discourse.Site.create(), "it can create with no parameters");
assert.ok(Site.create(), "it can create with no parameters");
});
QUnit.test("instance", assert => {
const site = Discourse.Site.current();
const site = Site.current();
assert.present(site, "We have a current site singleton");
assert.present(