Test signed-in helper CTA

This commit is contained in:
SimpleTest 2026-08-13 01:03:07 +03:00
parent 9c4367e822
commit 0393cadcad

View File

@ -1,6 +1,8 @@
defmodule WhoNeedHelpWeb.PageControllerTest do
use WhoNeedHelpWeb.ConnCase
import WhoNeedHelp.AccountsFixtures
test "GET /", %{conn: conn} do
conn = get(conn, ~p"/")
html = html_response(conn, 200)
@ -107,6 +109,18 @@ defmodule WhoNeedHelpWeb.PageControllerTest do
) == 1
end
test "GET / keeps helper discovery direct for a signed-in user", %{conn: conn} do
html =
conn
|> log_in_user(user_fixture())
|> get(~p"/")
|> html_response(200)
assert html =~ "I can help"
assert html =~ ~s(href="/requests")
refute html =~ "Log in to help"
end
test "private and authentication pages default to noindex", %{conn: conn} do
html = conn |> get(~p"/users/log-in") |> html_response(200)