2023-06-01 09:49:27 +00:00
|
|
|
defmodule PrymnWeb.PageControllerTest do
|
2023-07-28 20:44:00 +00:00
|
|
|
alias Prymn.Accounts
|
2023-06-01 09:49:27 +00:00
|
|
|
use PrymnWeb.ConnCase
|
|
|
|
|
2023-07-28 20:44:00 +00:00
|
|
|
import Prymn.AccountsFixtures
|
|
|
|
|
|
|
|
test "redirect unauthenticated user", %{conn: conn} do
|
2023-06-01 09:49:27 +00:00
|
|
|
conn = get(conn, ~p"/")
|
2023-07-28 20:44:00 +00:00
|
|
|
assert html_response(conn, 302) =~ "redirected"
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "authenticated" do
|
|
|
|
setup :register_and_log_in_user
|
|
|
|
|
|
|
|
test "shows page", %{conn: conn} do
|
|
|
|
conn = get(conn, ~p"/")
|
|
|
|
assert html_response(conn, 200)
|
|
|
|
end
|
2023-06-01 09:49:27 +00:00
|
|
|
end
|
|
|
|
end
|