Skip to content

Commit

Permalink
Update generated test descriptions for consistency (#5651)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhcarvalho authored Nov 24, 2023
1 parent 443dfb3 commit 718f248
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions priv/templates/phx.gen.auth/auth_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ defmodule <%= inspect auth_module %>Test do
end
end
describe "on_mount: mount_current_<%= schema.singular %>" do
describe "on_mount :mount_current_<%= schema.singular %>" do
test "assigns current_<%= schema.singular %> based on a valid <%= schema.singular %>_token", %{conn: conn, <%= schema.singular %>: <%= schema.singular %>} do
<%= schema.singular %>_token = <%= inspect context.alias %>.generate_<%= schema.singular %>_session_token(<%= schema.singular %>)
session = conn |> put_session(:<%= schema.singular %>_token, <%= schema.singular %>_token) |> get_session()
Expand Down Expand Up @@ -148,7 +148,7 @@ defmodule <%= inspect auth_module %>Test do
end
end

describe "on_mount: ensure_authenticated" do
describe "on_mount :ensure_authenticated" do
test "authenticates current_<%= schema.singular %> based on a valid <%= schema.singular %>_token", %{conn: conn, <%= schema.singular %>: <%= schema.singular %>} do
<%= schema.singular %>_token = <%= inspect context.alias %>.generate_<%= schema.singular %>_session_token(<%= schema.singular %>)
session = conn |> put_session(:<%= schema.singular %>_token, <%= schema.singular %>_token) |> get_session()
Expand Down Expand Up @@ -185,7 +185,7 @@ defmodule <%= inspect auth_module %>Test do
end
end

describe "on_mount: :redirect_if_<%= schema.singular %>_is_authenticated" do
describe "on_mount :redirect_if_<%= schema.singular %>_is_authenticated" do
test "redirects if there is an authenticated <%= schema.singular %> ", %{conn: conn, <%= schema.singular %>: <%= schema.singular %>} do
<%= schema.singular %>_token = <%= inspect context.alias %>.generate_<%= schema.singular %>_session_token(<%= schema.singular %>)
session = conn |> put_session(:<%= schema.singular %>_token, <%= schema.singular %>_token) |> get_session()
Expand Down

0 comments on commit 718f248

Please sign in to comment.