mercredi 14 mars 2018

Not understanding Plug.Conn.AlreadySentError

I have two tests which are very similar:

setup %{conn: conn} do
  {:ok, user} = #user coming from fixture
  {:ok, conn: conn, user: user}
end

test "user A ", %{conn: conn, user: user} do
  conn =
    conn
    |> login(user)
    |> get("/path")
end

test "user B",  %{conn: conn} do
  user = user_b #instanced fixture user with differnt params user_a
  conn =
    conn
    |> login(user)
    |> get("/path")
end

So differents users both testing the same endpoint

But I am receiving a ** (Plug.Conn.AlreadySentError) the response was already sent for the test user B at |> get("/path")

What I am supposed to do? recycle the conn? I tried with recycle() but didnt work

Aucun commentaire:

Enregistrer un commentaire