REFACTOR: Remove Discourse.SiteSettings from utilities

This involves a little refactoring of how our `defaultHomepage()` works.
It previously would check the meta tag / site settings each time it was
called but now it only checks once on application boot.
This commit is contained in:
Robin Ward
2020-07-23 13:43:29 -04:00
parent 4def5a8339
commit c4d5c0c91b
4 changed files with 44 additions and 34 deletions
@@ -1,7 +1,6 @@
import { acceptance } from "helpers/qunit-helpers";
acceptance("Login redirect", {});
acceptance("Login redirect");
QUnit.test("redirects login to default homepage", async function(assert) {
await visit("/login");
assert.equal(
@@ -9,8 +8,15 @@ QUnit.test("redirects login to default homepage", async function(assert) {
"discovery.latest",
"it works when latest is the homepage"
);
this.siteSettings.top_menu = "categories|latest|top|hot";
});
acceptance("Login redirect - categories default", {
settings: {
top_menu: "categories|latest|top|hot"
}
});
QUnit.test("when site setting is categories", async function(assert) {
await visit("/login");
assert.equal(
currentPath(),