I tried out encoding the body as json as @al2o3cr pointed out, I dont know why it works because Plug test docs says the maps are accepted (as I already said too)
this worked for me
test "POST /api/create_contract com dados válidos" do
body = Jason.encode!(%{
"chain" => "1",
"coin" => "ETH",
"transaction_value" => 2,
"transaction_charged" => 6.78,
"ref" => "REF123",
"ref_fee" => 2.0,
"payload" => "data_payload"
})
conn = conn(:post, "/api/create_contract", body)
|> put_req_header("content-type", "application/json")
|> TestesPay.MyRouter.call(body)
IO.inspect(conn, label: "Connection after MyRouter.call")
IO.inspect(conn.resp_body, label: "body response")
assert conn.status == 200
end






















