berrypod/test/berrypod_web/live/admin/theme_test.exs
jamey 6f0b7f4f63
All checks were successful
deploy / deploy (push) Successful in 1m41s
redirect /admin/theme to on-site editor at /?edit=theme
- Phase 5 was already implemented (URL mode activation via ?edit param)
- Phase 6: Add RedirectController to redirect /admin/theme → /?edit=theme
- Update admin sidebar and dashboard links to point directly to /?edit=theme
- Delete old Admin.Theme.Index LiveView and template (no longer needed)
- Update tests for new redirect behavior

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 20:30:33 +00:00

25 lines
617 B
Elixir

defmodule BerrypodWeb.Admin.ThemeTest do
use BerrypodWeb.ConnCase, async: false
import Berrypod.AccountsFixtures
setup do
user = user_fixture()
%{user: user}
end
describe "/admin/theme redirect" do
test "redirects unauthenticated users to login", %{conn: conn} do
conn = get(conn, ~p"/admin/theme")
assert redirected_to(conn) == ~p"/users/log-in"
end
test "redirects authenticated users to on-site editor", %{conn: conn, user: user} do
conn = conn |> log_in_user(user) |> get(~p"/admin/theme")
assert redirected_to(conn) == "/?edit=theme"
end
end
end