From 5bcf2b9bf4af24d81ead38feaae39829476b700b Mon Sep 17 00:00:00 2001 From: cmaddox5 Date: Tue, 2 Apr 2024 14:15:22 -0400 Subject: [PATCH] Use Plug instead of manual adding assigns. --- test/support/conn_case.ex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex index dc7ed203..bc161128 100644 --- a/test/support/conn_case.ex +++ b/test/support/conn_case.ex @@ -13,7 +13,6 @@ defmodule ScreenplayWeb.ConnCase do this option is not recommended for other databases. """ - import Plug.Conn use ExUnit.CaseTemplate using do @@ -45,7 +44,7 @@ defmodule ScreenplayWeb.ConnCase do "roles" => ["screenplay-emergency-admin"] }) |> Plug.Conn.put_session(:username, user) - |> assign(:roles, [:emergency_admin]) + |> Plug.run([{ScreenplayWeb.Plugs.Metadata, []}]) {conn, user} @@ -57,7 +56,7 @@ defmodule ScreenplayWeb.ConnCase do |> Plug.Test.init_test_session(%{}) |> Guardian.Plug.sign_in(ScreenplayWeb.AuthManager, user, %{roles: []}) |> Plug.Conn.put_session(:username, user) - |> assign(:roles, []) + |> Plug.run([{ScreenplayWeb.Plugs.Metadata, []}]) {conn, user} @@ -71,7 +70,7 @@ defmodule ScreenplayWeb.ConnCase do "roles" => ["pa-message-admin"] }) |> Plug.Conn.put_session(:username, user) - |> assign(:roles, [:pa_message_admin]) + |> Plug.run([{ScreenplayWeb.Plugs.Metadata, []}]) {conn, user}