lib/rspec/request_describer.rb in rspec-request_describer-0.1.0 vs lib/rspec/request_describer.rb in rspec-request_describer-0.1.1
- old
+ new
@@ -20,11 +20,17 @@
base.instance_eval do
subject do
send_request
end
- let(:send_request) do
- send http_method, path, request_body, env
+ if (ActionDispatch::Integration::Session.instance_method(:process_with_kwargs) rescue false)
+ let(:send_request) do
+ send http_method, path, params: request_body, headers: env
+ end
+ else
+ let(:send_request) do
+ send http_method, path, request_body, env
+ end
end
let(:request_body) do
if headers.any? { |key, value| key.downcase == "content-type" && value == "application/json" }
params.to_json