Skip to content

Commit

Permalink
fix: run test
Browse files Browse the repository at this point in the history
  • Loading branch information
Afonso-santos committed Jun 17, 2024
1 parent 653924d commit f3d29a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/atomic_web/controllers/user_session_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ defmodule AtomicWeb.UserSessionControllerTest do

describe "DELETE /users/log_out" do
test "logs the user out", %{conn: conn, user: user} do
conn = conn |> log_in_user(user) |> delete(Routes.user_session_path(conn, :delete))
conn = conn |> log_in_user(user) |> get(Routes.user_session_path(conn, :delete))
assert redirected_to(conn) == "/users/log_in"
refute get_session(conn, :user_token)
assert Phoenix.Flash.get(conn.assigns.flash, :info) =~ "Logged out successfully"
end

test "succeeds even if the user is not logged in", %{conn: conn} do
conn = delete(conn, Routes.user_session_path(conn, :delete))
conn = get(conn, Routes.user_session_path(conn, :delete))
assert redirected_to(conn) == "/users/log_in"
refute get_session(conn, :user_token)
end
Expand Down

0 comments on commit f3d29a5

Please sign in to comment.