test: add tests for join request page

This commit is contained in:
Simon 2026-03-10 17:18:14 +01:00
parent 21812542ad
commit eadf90b5fc
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
5 changed files with 173 additions and 4 deletions

View file

@ -60,13 +60,18 @@ defmodule MvWeb.JoinConfirmControllerTest do
end
@tag role: :unauthenticated
test "expired token returns 200 with expired message", %{conn: conn} do
test "expired token returns 200 with expired message and instructs to submit form again", %{
conn: conn
} do
Application.put_env(:mv, :join_confirm_callback, JoinConfirmExpiredStub)
conn = get(conn, "/confirm_join/expired-token")
body = response(conn, 200)
assert response(conn, 200) =~ "expired"
assert response(conn, 200) =~ "submit"
assert body =~ "expired"
assert body =~ "submit"
# Concept §2.5: clear message + "submit form again"
assert body =~ "form" or body =~ "again"
end
@tag role: :unauthenticated