Skip to content

Commit

Permalink
Merge pull request #5385 from florish/patch-1
Browse files Browse the repository at this point in the history
Fix typos in auth test names
  • Loading branch information
jeregrine committed Mar 30, 2023
2 parents e17d0db + 14a4b6f commit 319ff88
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions priv/templates/phx.gen.auth/auth_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ defmodule <%= inspect auth_module %>Test do
end
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
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 All @@ -128,7 +128,7 @@ defmodule <%= inspect auth_module %>Test do
assert updated_socket.assigns.current_<%= schema.singular %>.id == <%= schema.singular %>.id
end

test "assigns nil to current_<%= schema.singular %> assign if there isn't a valid <%= schema.singular %>_token ", %{conn: conn} do
test "assigns nil to current_<%= schema.singular %> assign if there isn't a valid <%= schema.singular %>_token", %{conn: conn} do
<%= schema.singular %>_token = "invalid_token"
session = conn |> put_session(:<%= schema.singular %>_token, <%= schema.singular %>_token) |> get_session()

Expand All @@ -149,7 +149,7 @@ defmodule <%= inspect auth_module %>Test do
end

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
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 All @@ -159,7 +159,7 @@ defmodule <%= inspect auth_module %>Test do
assert updated_socket.assigns.current_<%= schema.singular %>.id == <%= schema.singular %>.id
end

test "redirects to login page if there isn't a valid <%= schema.singular %>_token ", %{conn: conn} do
test "redirects to login page if there isn't a valid <%= schema.singular %>_token", %{conn: conn} do
<%= schema.singular %>_token = "invalid_token"
session = conn |> put_session(:<%= schema.singular %>_token, <%= schema.singular %>_token) |> get_session()

Expand All @@ -172,7 +172,7 @@ defmodule <%= inspect auth_module %>Test do
assert updated_socket.assigns.current_<%= schema.singular %> == nil
end

test "redirects to login page if there isn't a <%= schema.singular %>_token ", %{conn: conn} do
test "redirects to login page if there isn't a <%= schema.singular %>_token", %{conn: conn} do
session = conn |> get_session()

socket = %LiveView.Socket{
Expand All @@ -199,7 +199,7 @@ defmodule <%= inspect auth_module %>Test do
)
end

test "Don't redirect is there is no authenticated <%= schema.singular %>", %{conn: conn} do
test "doesn't redirect if there is no authenticated <%= schema.singular %>", %{conn: conn} do
session = conn |> get_session()

assert {:cont, _updated_socket} =
Expand Down

0 comments on commit 319ff88

Please sign in to comment.