mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
DEV: Remove some extra Discourse.Site
uses
This commit is contained in:
@ -3,6 +3,7 @@ import createStore from "helpers/create-store";
|
|||||||
import { autoLoadModules } from "discourse/initializers/auto-load-modules";
|
import { autoLoadModules } from "discourse/initializers/auto-load-modules";
|
||||||
import TopicTrackingState from "discourse/models/topic-tracking-state";
|
import TopicTrackingState from "discourse/models/topic-tracking-state";
|
||||||
import User from "discourse/models/user";
|
import User from "discourse/models/user";
|
||||||
|
import Site from "discourse/models/site";
|
||||||
|
|
||||||
export default function(name, opts) {
|
export default function(name, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
@ -12,7 +13,7 @@ export default function(name, opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test(name, function(assert) {
|
test(name, function(assert) {
|
||||||
this.site = Discourse.Site.current();
|
this.site = Site.current();
|
||||||
|
|
||||||
this.registry.register("site-settings:main", Discourse.SiteSettings, {
|
this.registry.register("site-settings:main", Discourse.SiteSettings, {
|
||||||
instantiate: false
|
instantiate: false
|
||||||
|
@ -2,6 +2,7 @@ import { run } from "@ember/runloop";
|
|||||||
import createStore from "helpers/create-store";
|
import createStore from "helpers/create-store";
|
||||||
import NavItem from "discourse/models/nav-item";
|
import NavItem from "discourse/models/nav-item";
|
||||||
import Category from "discourse/models/category";
|
import Category from "discourse/models/category";
|
||||||
|
import Site from "discourse/models/site";
|
||||||
|
|
||||||
QUnit.module("NavItem", {
|
QUnit.module("NavItem", {
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
@ -10,7 +11,7 @@ QUnit.module("NavItem", {
|
|||||||
name: "确实是这样",
|
name: "确实是这样",
|
||||||
id: 343434
|
id: 343434
|
||||||
});
|
});
|
||||||
Discourse.Site.currentProp("categories").addObject(asianCategory);
|
Site.currentProp("categories").addObject(asianCategory);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
import createStore from "helpers/create-store";
|
import createStore from "helpers/create-store";
|
||||||
|
import Site from "discourse/models/site";
|
||||||
|
|
||||||
QUnit.module("model:site");
|
QUnit.module("model:site");
|
||||||
|
|
||||||
QUnit.test("create", assert => {
|
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 => {
|
QUnit.test("instance", assert => {
|
||||||
const site = Discourse.Site.current();
|
const site = Site.current();
|
||||||
|
|
||||||
assert.present(site, "We have a current site singleton");
|
assert.present(site, "We have a current site singleton");
|
||||||
assert.present(
|
assert.present(
|
||||||
|
Reference in New Issue
Block a user