Environment
- Elixir version (elixir -v): 1.9.0
- Phoenix version (mix deps): 1.4.10
- NodeJS version (node -v): v12.1.0
- NPM version (npm -v): 6.9.0
- Operating system: MacOS Mojave
Expected behavior
Phoenix.ConnTest.get("/foo", %{count: 5}) should result in the controller receiving the count param as a string value, reflecting the behavior of curl http://localhost:4000/foo?count=5.
Actual behavior
Phoenix.ConnTest.get("/foo", %{count: 5}) results in the controller receiving the count param as an integer value. It does not appear to be possible for a real HTTP GET to do this.
Impact
Controller code can be written which treats a param as an integer, and even though this will fail in real usage, the tests make it appear to work. When the bug in the application code is discovered and fixed, all tests have to be updated to explicitly pass the param as a string, like Phoenix.ConnTest.get("/foo", %{count: "5"})
Details and Demo
https://github.com/nathanl/param_test
Environment
Expected behavior
Phoenix.ConnTest.get("/foo", %{count: 5})should result in the controller receiving thecountparam as a string value, reflecting the behavior ofcurl http://localhost:4000/foo?count=5.Actual behavior
Phoenix.ConnTest.get("/foo", %{count: 5})results in the controller receiving thecountparam as an integer value. It does not appear to be possible for a realHTTP GETto do this.Impact
Controller code can be written which treats a param as an integer, and even though this will fail in real usage, the tests make it appear to work. When the bug in the application code is discovered and fixed, all tests have to be updated to explicitly pass the param as a string, like
Phoenix.ConnTest.get("/foo", %{count: "5"})Details and Demo
https://github.com/nathanl/param_test