Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Simplify the patch code

Christophe Bliardc048e1111284
diff --git a/spec/support/have_http_status_with_rack_response.rb b/spec/support/have_http_status_with_rack_response.rb
index 47dfd80c791..f933d04d1b9 100644
--- a/spec/support/have_http_status_with_rack_response.rb
+++ b/spec/support/have_http_status_with_rack_response.rb
@@ -32,10 +32,9 @@ module HaveHttpStatusWithRackResponse
# `have_http_status` matcher would fail if the response object is a
# `Rack::MockResponse`. Hack to disguise `Rack::MockResponse` into a
# `ActionDispatch::TestResponse` object.
- obj = ActionDispatch::Response.new(obj.status, obj.headers, obj.body).tap do |resp|
- resp.request = ActionDispatch::Request.new({})
- end
- ::ActionDispatch::TestResponse.from_response(obj)
+ response = ActionDispatch::Response.new(obj.status, obj.headers, obj.body)
+ response.request = ActionDispatch::Request.new({})
+ ::ActionDispatch::TestResponse.from_response(response)
else
super
end