Rails functional test: sending URL query parameters in POST request
问题 I'm sending a POST request in a Rails functional test like this: post :create, collection: { name: 'New Collection' } collection gets sent as JSON-encoded form data, as expected. What I can't figure out is how to add a query to the URL. The documentation says that I can access the request object and modify it before it gets sent. So I tried this: @request.GET[:api_key] = 'my key' post :create, collection: { name: 'New Collection' } But, :api_key never appears in the request.GET hash on the