All checks were successful
deploy / deploy (push) Successful in 1m41s
- 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>
25 lines
617 B
Elixir
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
|