After upgrading from Rails 4.2 to 5.1 it seems that only for the tests, when I provide something like:
post :create, params: {
model: {
prices: [[2000, "EUR"], [2113.56, "USD"]],
estimates: [[50, 2500, "EUR"], [505, 2600, "USD"]]
}
}
It is then parsed within the params of the controller as:
prices: [["2000"], ["EUR"], ["2113.56"], ["USD"]]
estimates: [["50"], ["2500"], ["EUR"], ["505"], ["2600"], ["USD"]]
Fortunately, actual calls to the controller are parsed correctly. I need the tests fixed though obviously, so any help would be really appreciated!
Found the answer after so much time..
We thought that by having only:
@request.headers['Accept'] = 'application/json'
in setup was ok.
But we also had to include:
@request.headers['Content-Type'] = 'application/json'
in order for the params to be parsed correctly!