Why Phoenix Recycling?

Maybe Plug.Test — Plug v1.20.2

setup %{conn: conn} do
  {:ok, conn: Plug.Test.init_test_session(conn, user_id: 666)}
end

I wouldn’t change assigns manually, instead I’d pipe the requests through the actual plug pipelines with the session set via Plug.Test.init_test_session/2 to get the expected conn with all relevant assigns set.