I am trying to pass in a list of integers to as the body to a post call in a Controller test in Phoenix like so:
params = %{
int_list: [3, 6, 12, 24],
}
conn = post(conn, Routes.my_path(conn, :update, params))
assert json_response(conn, 200) ==
%{
"data" => %{
"list" => [3, 6, 12, 24]
}
}
But this gives an error because the list has become a list of strings and when I inspect the params passed to this route in the controller the list becomes:
["3", "6", "12", "24"]
Do I have to de-serialize this myself or am I not passing the parameters in correctly in my test? Thank you!