Skip to content

Commit

Permalink
Add missing ~p in phx.gen.auth templates (#5899)
Browse files Browse the repository at this point in the history
For consistency with other URLs that use VerifiedRoutes.
  • Loading branch information
rhcarvalho authored Aug 14, 2024
1 parent 5e95d95 commit f6a04d9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions priv/templates/phx.gen.auth/confirmation_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
lv
|> form("#confirmation_form")
|> render_submit()
|> follow_redirect(conn, "/")
|> follow_redirect(conn, ~p"/")

assert {:ok, conn} = result

Expand All @@ -47,7 +47,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
lv
|> form("#confirmation_form")
|> render_submit()
|> follow_redirect(conn, "/")
|> follow_redirect(conn, ~p"/")

assert {:ok, conn} = result

Expand All @@ -65,7 +65,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
lv
|> form("#confirmation_form")
|> render_submit()
|> follow_redirect(conn, "/")
|> follow_redirect(conn, ~p"/")

assert {:ok, conn} = result
refute Phoenix.Flash.get(conn.assigns.flash, :error)
Expand Down
4 changes: 2 additions & 2 deletions priv/templates/phx.gen.auth/forgot_password_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
lv
|> form("#reset_password_form", <%= schema.singular %>: %{"email" => <%= schema.singular %>.email})
|> render_submit()
|> follow_redirect(conn, "/")
|> follow_redirect(conn, ~p"/")

assert Phoenix.Flash.get(conn.assigns.flash, :info) =~ "If your email is in our system"

Expand All @@ -54,7 +54,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
lv
|> form("#reset_password_form", <%= schema.singular %>: %{"email" => "[email protected]"})
|> render_submit()
|> follow_redirect(conn, "/")
|> follow_redirect(conn, ~p"/")

assert Phoenix.Flash.get(conn.assigns.flash, :info) =~ "If your email is in our system"
assert Repo.all(<%= inspect context.alias %>.<%= inspect schema.alias %>Token) == []
Expand Down
2 changes: 1 addition & 1 deletion priv/templates/phx.gen.auth/login_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
conn
|> log_in_<%= schema.singular %>(<%= schema.singular %>_fixture())
|> live(~p"<%= schema.route_prefix %>/log_in")
|> follow_redirect(conn, "/")
|> follow_redirect(conn, ~p"/")

assert {:ok, _conn} = result
end
Expand Down
4 changes: 2 additions & 2 deletions priv/templates/phx.gen.auth/registration_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
conn
|> log_in_<%= schema.singular %>(<%= schema.singular %>_fixture())
|> live(~p"<%= schema.route_prefix %>/register")
|> follow_redirect(conn, "/")
|> follow_redirect(conn, ~p"/")

assert {:ok, _conn} = result
end
Expand Down Expand Up @@ -48,7 +48,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
assert redirected_to(conn) == ~p"/"

# Now do a logged in request and assert on the menu
conn = get(conn, "/")
conn = get(conn, ~p"/")
response = html_response(conn, 200)
assert response =~ email
assert response =~ "Settings"
Expand Down

0 comments on commit f6a04d9

Please sign in to comment.