We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fda9e9 commit 3bf5af1Copy full SHA for 3bf5af1
lib/rspec/rails/matchers/have_http_status.rb
@@ -43,8 +43,10 @@ def as_test_response(obj)
43
# Capybara or catch `NameError`s for the undefined constants
44
obj = ActionDispatch::Response.new.tap do |resp|
45
resp.status = obj.status_code
46
- resp.headers = obj.response_headers
+ resp.headers.clear
47
+ resp.headers.merge!(obj.response_headers)
48
resp.body = obj.body
49
+ resp.request = ActionDispatch::Request.new({})
50
end
51
::ActionDispatch::TestResponse.from_response(obj)
52
else
0 commit comments