FIX: Redirect to default homepage when visiting /login

Previously this was hard-coded to redirect to `/latest`
This commit is contained in:
David Taylor
2018-12-10 15:39:05 +00:00
parent ef7f84b59b
commit 071bd15463
2 changed files with 22 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
import { acceptance } from "helpers/qunit-helpers";
acceptance("Login redirect", {});
QUnit.test("redirects categories to top", async assert => {
await visit("/login");
assert.equal(
currentPath(),
"discovery.latest",
"it works when latest is the homepage"
);
Discourse.SiteSettings.top_menu = "categories|latest|top|hot";
await visit("/login");
assert.equal(
currentPath(),
"discovery.categories",
"it works when categories is the homepage"
);
});