mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Convert server side paths to use /u/
This commit is contained in:
@@ -30,7 +30,7 @@ acceptance("Password Reset", {
|
||||
test("Password Reset Page", () => {
|
||||
PreloadStore.store('password_reset', {is_developer: false});
|
||||
|
||||
visit("/users/password-reset/myvalidtoken");
|
||||
visit("/u/password-reset/myvalidtoken");
|
||||
andThen(() => {
|
||||
ok(exists(".password-reset input"), "shows the input");
|
||||
});
|
||||
|
||||
@@ -35,7 +35,7 @@ acceptance("Plugin Outlet - Connector Class", {
|
||||
});
|
||||
|
||||
test("Renders a template into the outlet", assert => {
|
||||
visit("/users/eviltrout");
|
||||
visit("/u/eviltrout");
|
||||
andThen(() => {
|
||||
assert.ok(find('.user-profile-primary-outlet.hello').length === 1, 'it has class names');
|
||||
assert.ok(!find('.user-profile-primary-outlet.dont-render').length, "doesn't render");
|
||||
|
||||
@@ -19,7 +19,7 @@ acceptance("Plugin Outlet - Multi Template", {
|
||||
});
|
||||
|
||||
test("Renders a template into the outlet", assert => {
|
||||
visit("/users/eviltrout");
|
||||
visit("/u/eviltrout");
|
||||
andThen(() => {
|
||||
assert.ok(find('.user-profile-primary-outlet.hello').length === 1, 'it has class names');
|
||||
assert.ok(find('.user-profile-primary-outlet.goodbye').length === 1, 'it has class names');
|
||||
|
||||
@@ -14,7 +14,7 @@ acceptance("Plugin Outlet - Single Template", {
|
||||
});
|
||||
|
||||
test("Renders a template into the outlet", assert => {
|
||||
visit("/users/eviltrout");
|
||||
visit("/u/eviltrout");
|
||||
andThen(() => {
|
||||
assert.ok(find('.user-profile-primary-outlet.hello').length === 1, 'it has class names');
|
||||
assert.equal(find('.hello-username').text(), 'eviltrout', 'it renders into the outlet');
|
||||
|
||||
@@ -2,11 +2,11 @@ import { acceptance } from "helpers/qunit-helpers";
|
||||
acceptance("User Preferences", { loggedIn: true });
|
||||
|
||||
test("update some fields", () => {
|
||||
visit("/users/eviltrout/preferences");
|
||||
visit("/u/eviltrout/preferences");
|
||||
|
||||
andThen(() => {
|
||||
ok($('body.user-preferences-page').length, "has the body class");
|
||||
equal(currentURL(), '/users/eviltrout/preferences', "it doesn't redirect");
|
||||
equal(currentURL(), '/u/eviltrout/preferences', "it doesn't redirect");
|
||||
ok(exists('.user-preferences'), 'it shows the preferences');
|
||||
});
|
||||
|
||||
@@ -20,21 +20,21 @@ test("update some fields", () => {
|
||||
});
|
||||
|
||||
test("username", () => {
|
||||
visit("/users/eviltrout/preferences/username");
|
||||
visit("/u/eviltrout/preferences/username");
|
||||
andThen(() => {
|
||||
ok(exists("#change_username"), "it has the input element");
|
||||
});
|
||||
});
|
||||
|
||||
test("about me", () => {
|
||||
visit("/users/eviltrout/preferences/about-me");
|
||||
visit("/u/eviltrout/preferences/about-me");
|
||||
andThen(() => {
|
||||
ok(exists(".raw-bio"), "it has the input element");
|
||||
});
|
||||
});
|
||||
|
||||
test("email", () => {
|
||||
visit("/users/eviltrout/preferences/email");
|
||||
visit("/u/eviltrout/preferences/email");
|
||||
andThen(() => {
|
||||
ok(exists("#change-email"), "it has the input element");
|
||||
});
|
||||
|
||||
@@ -40,7 +40,7 @@ test("search scope checkbox", () => {
|
||||
});
|
||||
click('#search-button');
|
||||
|
||||
visit("/users/eviltrout");
|
||||
visit("/u/eviltrout");
|
||||
click('#search-button');
|
||||
andThen(() => {
|
||||
ok(exists('.search-context input:checked'), 'scope to user checkbox is checked');
|
||||
|
||||
@@ -16,7 +16,7 @@ function hasTopicList() {
|
||||
}
|
||||
|
||||
test("Root URL", () => {
|
||||
visit("/users/eviltrout");
|
||||
visit("/u/eviltrout");
|
||||
andThen(() => {
|
||||
ok($('body.user-summary-page').length, "has the body class");
|
||||
equal(currentPath(), 'user.summary', "it defaults to summary");
|
||||
@@ -24,21 +24,21 @@ test("Root URL", () => {
|
||||
});
|
||||
|
||||
test("Filters", () => {
|
||||
visit("/users/eviltrout/activity");
|
||||
visit("/u/eviltrout/activity");
|
||||
andThen(() => {
|
||||
ok($('body.user-activity-page').length, "has the body class");
|
||||
});
|
||||
hasStream();
|
||||
|
||||
visit("/users/eviltrout/activity/topics");
|
||||
visit("/u/eviltrout/activity/topics");
|
||||
hasTopicList();
|
||||
|
||||
visit("/users/eviltrout/activity/replies");
|
||||
visit("/u/eviltrout/activity/replies");
|
||||
hasStream();
|
||||
});
|
||||
|
||||
test("Badges", () => {
|
||||
visit("/users/eviltrout/badges");
|
||||
visit("/u/eviltrout/badges");
|
||||
andThen(() => {
|
||||
ok($('body.user-badges-page').length, "has the body class");
|
||||
ok(exists(".user-badges-list .badge-card"), "shows a badge");
|
||||
@@ -46,7 +46,7 @@ test("Badges", () => {
|
||||
});
|
||||
|
||||
test("Restricted Routes", () => {
|
||||
visit("/users/eviltrout/preferences");
|
||||
visit("/u/eviltrout/preferences");
|
||||
|
||||
andThen(() => {
|
||||
equal(currentURL(), '/u/eviltrout/activity', "it redirects from preferences");
|
||||
|
||||
@@ -3,28 +3,28 @@ import { acceptance } from "helpers/qunit-helpers";
|
||||
acceptance("User", {loggedIn: true});
|
||||
|
||||
test("Invites", () => {
|
||||
visit("/users/eviltrout/invited/pending");
|
||||
visit("/u/eviltrout/invited/pending");
|
||||
andThen(() => {
|
||||
ok($('body.user-invites-page').length, "has the body class");
|
||||
});
|
||||
});
|
||||
|
||||
test("Messages", () => {
|
||||
visit("/users/eviltrout/messages");
|
||||
visit("/u/eviltrout/messages");
|
||||
andThen(() => {
|
||||
ok($('body.user-messages-page').length, "has the body class");
|
||||
});
|
||||
});
|
||||
|
||||
test("Notifications", () => {
|
||||
visit("/users/eviltrout/notifications");
|
||||
visit("/u/eviltrout/notifications");
|
||||
andThen(() => {
|
||||
ok($('body.user-notifications-page').length, "has the body class");
|
||||
});
|
||||
});
|
||||
|
||||
test("Root URL - Viewing Self", () => {
|
||||
visit("/users/eviltrout");
|
||||
visit("/u/eviltrout");
|
||||
andThen(() => {
|
||||
ok($('body.user-activity-page').length, "has the body class");
|
||||
equal(currentPath(), 'user.userActivity.index', "it defaults to activity");
|
||||
|
||||
@@ -440,7 +440,7 @@ export default {
|
||||
},
|
||||
{
|
||||
"id":94544,
|
||||
"cooked":"<p><a class=\"mention\" href=\"/users/techapj\">@techapj</a> fixed this for 1.2.</p>",
|
||||
"cooked":"<p><a class=\"mention\" href=\"/u/techapj\">@techapj</a> fixed this for 1.2.</p>",
|
||||
"created_at":"2015-01-23T05:49:35.881Z",
|
||||
"title":"After sign-in, I'm not redirected to the conversation",
|
||||
"url":"/t/after-sign-in-im-not-redirected-to-the-conversation/17753/8",
|
||||
@@ -540,7 +540,7 @@ export default {
|
||||
},
|
||||
{
|
||||
"id":94542,
|
||||
"cooked":"<p>Hmm that looks like a bug, <a class=\"mention\" href=\"/users/techapj\">@techapj</a> can you have a look?</p>",
|
||||
"cooked":"<p>Hmm that looks like a bug, <a class=\"mention\" href=\"/u/techapj\">@techapj</a> can you have a look?</p>",
|
||||
"created_at":"2015-01-23T05:43:55.602Z",
|
||||
"title":"RSS is not valid",
|
||||
"url":"/t/rss-is-not-valid/24338/2",
|
||||
@@ -590,7 +590,7 @@ export default {
|
||||
},
|
||||
{
|
||||
"id":94522,
|
||||
"cooked":"<p>Oh I see. <a class=\"mention\" href=\"/users/zogstrip\">@zogstrip</a> can you have a look?</p>",
|
||||
"cooked":"<p>Oh I see. <a class=\"mention\" href=\"/u/zogstrip\">@zogstrip</a> can you have a look?</p>",
|
||||
"created_at":"2015-01-23T03:00:20.485Z",
|
||||
"title":"Pasted image upload size error",
|
||||
"url":"/t/pasted-image-upload-size-error/24320/4",
|
||||
@@ -640,7 +640,7 @@ export default {
|
||||
},
|
||||
{
|
||||
"id":94521,
|
||||
"cooked":"<p><a class=\"mention\" href=\"/users/techapj\">@techapj</a> fixed this for 1.2.</p>",
|
||||
"cooked":"<p><a class=\"mention\" href=\"/u/techapj\">@techapj</a> fixed this for 1.2.</p>",
|
||||
"created_at":"2015-01-23T02:58:27.451Z",
|
||||
"title":"The end of Clown Vomit, or, simplified category styles",
|
||||
"url":"/t/the-end-of-clown-vomit-or-simplified-category-styles/24249/57",
|
||||
|
||||
@@ -92,13 +92,13 @@ test("url", function() {
|
||||
var t, testClass;
|
||||
|
||||
testClass = Em.Object.extend({
|
||||
userUrl: url('username', "/users/%@")
|
||||
userUrl: url('username', "/u/%@")
|
||||
});
|
||||
|
||||
t = testClass.create({ username: 'eviltrout' });
|
||||
equal(t.get('userUrl'), "/users/eviltrout", "it supports urls without a prefix");
|
||||
equal(t.get('userUrl'), "/u/eviltrout", "it supports urls without a prefix");
|
||||
|
||||
Discourse.BaseUri = "/prefixed";
|
||||
t = testClass.create({ username: 'eviltrout' });
|
||||
equal(t.get('userUrl'), "/prefixed/users/eviltrout", "it supports urls with a prefix");
|
||||
equal(t.get('userUrl'), "/prefixed/u/eviltrout", "it supports urls with a prefix");
|
||||
});
|
||||
|
||||
@@ -3,5 +3,5 @@ module("lib:discourse");
|
||||
test("getURL on subfolder install", function() {
|
||||
Discourse.BaseUri = "/forum";
|
||||
equal(Discourse.getURL("/"), "/forum/", "root url has subfolder");
|
||||
equal(Discourse.getURL("/users/neil"), "/forum/users/neil", "relative url has subfolder");
|
||||
});
|
||||
equal(Discourse.getURL("/u/neil"), "/forum/u/neil", "relative url has subfolder");
|
||||
});
|
||||
|
||||
@@ -130,8 +130,8 @@ test("Links", function() {
|
||||
"<p>Here's a tweet:<br/><a href=\"https://twitter.com/evil_trout/status/345954894420787200\" class=\"onebox\" target=\"_blank\">https://twitter.com/evil_trout/status/345954894420787200</a></p>",
|
||||
"It doesn't strip the new line.");
|
||||
|
||||
cooked("1. View @eviltrout's profile here: http://meta.discourse.org/users/eviltrout/activity<br/>next line.",
|
||||
"<ol><li>View <span class=\"mention\">@eviltrout</span>'s profile here: <a href=\"http://meta.discourse.org/users/eviltrout/activity\">http://meta.discourse.org/users/eviltrout/activity</a><br>next line.</li></ol>",
|
||||
cooked("1. View @eviltrout's profile here: http://meta.discourse.org/u/eviltrout/activity<br/>next line.",
|
||||
"<ol><li>View <span class=\"mention\">@eviltrout</span>'s profile here: <a href=\"http://meta.discourse.org/u/eviltrout/activity\">http://meta.discourse.org/u/eviltrout/activity</a><br>next line.</li></ol>",
|
||||
"allows autolinking within a list without inserting a paragraph.");
|
||||
|
||||
cooked("[3]: http://eviltrout.com", "", "It doesn't autolink markdown link references");
|
||||
|
||||
@@ -7,7 +7,7 @@ widgetTest('basic rendering', {
|
||||
setup() {
|
||||
this.set('args', {
|
||||
username: 'eviltrout',
|
||||
usernameUrl: '/users/eviltrout',
|
||||
usernameUrl: '/u/eviltrout',
|
||||
name: 'Robin Ward',
|
||||
user_title: 'Trout Master' });
|
||||
},
|
||||
@@ -26,7 +26,7 @@ widgetTest('extra classes and glyphs', {
|
||||
setup() {
|
||||
this.set('args', {
|
||||
username: 'eviltrout',
|
||||
usernameUrl: '/users/eviltrout',
|
||||
usernameUrl: '/u/eviltrout',
|
||||
staff: true,
|
||||
admin: true,
|
||||
moderator: true,
|
||||
|
||||
Reference in New Issue
Block a user