Convert front end paths from /users/ to /u/

This commit is contained in:
Robin Ward
2017-03-28 12:16:58 -04:00
parent 6b976433c9
commit 45a257815a
40 changed files with 129 additions and 84 deletions

View File

@@ -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");
});

View File

@@ -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');
});

View File

@@ -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: [