mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Convert front end paths from /users/ to /u/
This commit is contained in:
@@ -227,7 +227,7 @@ test("Mentions", function() {
|
||||
const alwaysTrue = { mentionLookup: (function() { return "user"; }) };
|
||||
|
||||
cookedOptions("Hello @sam", alwaysTrue,
|
||||
"<p>Hello <a class=\"mention\" href=\"/users/sam\">@sam</a></p>",
|
||||
"<p>Hello <a class=\"mention\" href=\"/u/sam\">@sam</a></p>",
|
||||
"translates mentions to links");
|
||||
|
||||
cooked("[@codinghorror](https://twitter.com/codinghorror)",
|
||||
@@ -303,11 +303,11 @@ test("Mentions", function() {
|
||||
"handles mentions separated by a slash.");
|
||||
|
||||
cookedOptions("@eviltrout", alwaysTrue,
|
||||
"<p><a class=\"mention\" href=\"/users/eviltrout\">@eviltrout</a></p>",
|
||||
"<p><a class=\"mention\" href=\"/u/eviltrout\">@eviltrout</a></p>",
|
||||
"it doesn't onebox mentions");
|
||||
|
||||
cookedOptions("<small>a @sam c</small>", alwaysTrue,
|
||||
"<p><small>a <a class=\"mention\" href=\"/users/sam\">@sam</a> c</small></p>",
|
||||
"<p><small>a <a class=\"mention\" href=\"/u/sam\">@sam</a> c</small></p>",
|
||||
"it allows mentions within HTML tags");
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import DiscourseURL from 'discourse/lib/url';
|
||||
import { default as DiscourseURL, userPath } from 'discourse/lib/url';
|
||||
|
||||
module("lib:url");
|
||||
|
||||
@@ -25,3 +25,9 @@ test("isInternal on subfolder install", function() {
|
||||
not(DiscourseURL.isInternal("http://eviltrout.com/tophat"), "a url on the same host but on a different folder is not internal");
|
||||
ok(DiscourseURL.isInternal("http://eviltrout.com/forum/moustache"), "a url on the same host and on the same folder is internal");
|
||||
});
|
||||
|
||||
test("userPath", assert => {
|
||||
assert.equal(userPath(), '/u');
|
||||
assert.equal(userPath('eviltrout'), '/u/eviltrout');
|
||||
assert.equal(userPath('hp.json'), '/u/hp.json');
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ module("lib:user-search", {
|
||||
];
|
||||
};
|
||||
|
||||
server.get('/users/search/users', () => { //eslint-disable-line
|
||||
server.get('/u/search/users', () => { //eslint-disable-line
|
||||
return response(
|
||||
{
|
||||
users: [
|
||||
|
||||
Reference in New Issue
Block a user