Allow bulk importer through prelaunch gate (#159)

The new EndgameLive.Import view was missing from the prelaunch allowlist, so PRELAUNCH=true redirected it to the home page.
This commit is contained in:
2026-11-12 22:58:34 +01:00
committed by GitHub
parent fddb94e2bd
commit f27e16af1d
2 changed files with 13 additions and 0 deletions
+1
View File
@@ -219,6 +219,7 @@ defmodule ChesstrainerWeb.UserAuth do
ChesstrainerWeb.EndgameLive.Index,
ChesstrainerWeb.EndgameLive.Form,
ChesstrainerWeb.EndgameLive.Show,
ChesstrainerWeb.EndgameLive.Import,
ChesstrainerWeb.Admin.ThemeLive.Index,
ChesstrainerWeb.Admin.ThemeLive.Form,
ChesstrainerWeb.Admin.UserLive.Index,
@@ -62,6 +62,18 @@ defmodule ChesstrainerWeb.Plugs.PrelaunchTest do
assert get_resp_header(conn, "x-robots-tag") == ["noindex, nofollow"]
end
test "allows the admin bulk import page", %{conn: conn} do
admin =
user_fixture()
|> Ecto.Changeset.change(role: :admin)
|> Repo.update!()
conn = log_in_user(conn, admin)
assert {:ok, _view, html} = live(conn, ~p"/admin/endgames/import")
assert html =~ "Import endgames"
end
test "redirects registration and unknown pages", %{conn: conn} do
assert conn |> get(~p"/users/register") |> redirected_to() == "/"
assert conn |> get("/definitely-not-a-page") |> redirected_to() == "/"