Conversation
I added `query`. It can be defined as Hash, similar to `params`. Defining as String is not supported.
|
Introducing this change could cause issues if a |
|
By the way, in the example you gave, you're specifying a I’m aware that there are exceptions like Elasticsearch that require it, but in general, GET requests do not include a body. I’d be interested to know what kind of use case you had in mind. |
Motivation / Background
In request spec, even if you set query parameters to
params, we can set values to Controller'sparams.However, when
application/jsonis set forContent-Type, RSpec::RequestDescriber convertsparamsto a JSON string usingto_json, so even if query parameters are set inparams, the test will not work correctly.In actual behavior, query parameters should be included in the
path, and it is preferable to verify the actual behavior as much as possible in tests.Details
I added
query. It can be defined as Hash, similar toparams. Defining as String is not supported.