From b319f5640a5b87c2c3fb43716097e87d75108821 Mon Sep 17 00:00:00 2001 From: shibao Date: Wed, 16 Feb 2022 20:59:22 -0500 Subject: [PATCH] pass user auth test --- test/cannery_web/controllers/user_auth_test.exs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/cannery_web/controllers/user_auth_test.exs b/test/cannery_web/controllers/user_auth_test.exs index e2727d7..bbb45df 100644 --- a/test/cannery_web/controllers/user_auth_test.exs +++ b/test/cannery_web/controllers/user_auth_test.exs @@ -1,10 +1,13 @@ defmodule CanneryWeb.UserAuthTest do - use CanneryWeb.ConnCase, async: true + @moduledoc """ + Tests user auth + """ + use CanneryWeb.ConnCase, async: true alias Cannery.Accounts alias CanneryWeb.UserAuth - import Cannery.AccountsFixtures + @moduletag :user_auth_test @remember_me_cookie "_cannery_web_user_remember_me" setup %{conn: conn} do @@ -140,7 +143,7 @@ defmodule CanneryWeb.UserAuthTest do test "stores the path to redirect to on GET", %{conn: conn} do halted_conn = - %{conn | request_path: "/foo", query_string: ""} + %{conn | path_info: ["foo"], query_string: ""} |> fetch_flash() |> UserAuth.require_authenticated_user([]) @@ -148,7 +151,7 @@ defmodule CanneryWeb.UserAuthTest do assert get_session(halted_conn, :user_return_to) == "/foo" halted_conn = - %{conn | request_path: "/foo", query_string: "bar=baz"} + %{conn | path_info: ["foo"], query_string: "bar=baz"} |> fetch_flash() |> UserAuth.require_authenticated_user([]) @@ -156,7 +159,7 @@ defmodule CanneryWeb.UserAuthTest do assert get_session(halted_conn, :user_return_to) == "/foo?bar=baz" halted_conn = - %{conn | request_path: "/foo?bar", method: "POST"} + %{conn | path_info: ["/foo?bar"], method: "POST"} |> fetch_flash() |> UserAuth.require_authenticated_user([])