Test signed-in helper CTA
This commit is contained in:
parent
9c4367e822
commit
0393cadcad
|
|
@ -1,6 +1,8 @@
|
||||||
defmodule WhoNeedHelpWeb.PageControllerTest do
|
defmodule WhoNeedHelpWeb.PageControllerTest do
|
||||||
use WhoNeedHelpWeb.ConnCase
|
use WhoNeedHelpWeb.ConnCase
|
||||||
|
|
||||||
|
import WhoNeedHelp.AccountsFixtures
|
||||||
|
|
||||||
test "GET /", %{conn: conn} do
|
test "GET /", %{conn: conn} do
|
||||||
conn = get(conn, ~p"/")
|
conn = get(conn, ~p"/")
|
||||||
html = html_response(conn, 200)
|
html = html_response(conn, 200)
|
||||||
|
|
@ -107,6 +109,18 @@ defmodule WhoNeedHelpWeb.PageControllerTest do
|
||||||
) == 1
|
) == 1
|
||||||
end
|
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
|
test "private and authentication pages default to noindex", %{conn: conn} do
|
||||||
html = conn |> get(~p"/users/log-in") |> html_response(200)
|
html = conn |> get(~p"/users/log-in") |> html_response(200)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user