mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 03:32:06 +00:00
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:
@@ -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() == "/"
|
||||
|
||||
Reference in New Issue
Block a user