mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
DEV: Move Discourse.getURL
and related functions to a module (#9966)
* DEV: Move `Discourse.getURL` and related functions to a module * DEV: Remove `Discourse.getURL` and `Discourse.getURLWithCDN` * FIX: `get-url` is required for server side code * DEV: Deprecate `BaseUri` too.
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import DiscourseURL, { userPath } from "discourse/lib/url";
|
||||
import { setPrefix } from "discourse-common/lib/get-url";
|
||||
|
||||
QUnit.module("lib:url");
|
||||
|
||||
@ -59,8 +60,8 @@ QUnit.test("userPath", assert => {
|
||||
assert.equal(userPath("hp.json"), "/u/hp.json");
|
||||
});
|
||||
|
||||
QUnit.test("userPath with BaseUri", assert => {
|
||||
Discourse.BaseUri = "/forum";
|
||||
QUnit.test("userPath with prefix", assert => {
|
||||
setPrefix("/forum");
|
||||
assert.equal(userPath(), "/forum/u");
|
||||
assert.equal(userPath("eviltrout"), "/forum/u/eviltrout");
|
||||
assert.equal(userPath("hp.json"), "/forum/u/hp.json");
|
||||
|
Reference in New Issue
Block a user