How to correctly send query parameters in RSpec with wrap parameters on?
|Added at||2017-01-02 21:01|
I'm building a REST api with Rails 4.2.6. I recently discovered the use of wrap parameters, and set those to JSON, to simplify the requests that my clients have to make. So, for instance, from a controller called SubOrder, they can now send the request parameter of "name" instead of "sub_order[name]". That's all well and good, and it works in Postman. However, my RSpec tests are now failing, saying that I'm not sending the SubOrder parameter. I also set my sub_order_params method to:
Before the change, they looked like this:
So while the api works in the way that I've intended it to, I'd like to know how to structure my RSpec controller tests correctly to make them pass?