** (ArgumentError) cannot encode maps inside lists when the map has 0 or more than 1 elements, got: %{op: "replace", path: "/firstName", value: "George"}
test "can be used to update a field on a user", %{conn: conn} do
result =
conn
|> put_req_header("authorization", @auth_token)
|> patch(
api_v2_users_path(
conn,
:update,
@user_one_id,
_json: %{
0 => %{op: "replace", path: "firstName", value: "George of the"},
1 => %{op: "replace", path: "lastName", value: "Jungle"}
}
)
)
|> json_response(200)
... assertions ...
end
But I do not have a project at hand to test it. Its just an aussmption, based on the fact that the path helpers append parameters to the query-part of the URL.