aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/http/response.rb4
-rw-r--r--actionpack/test/dispatch/response_test.rb4
2 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb
index 72871e328a..8e03a7879f 100644
--- a/actionpack/lib/action_dispatch/http/response.rb
+++ b/actionpack/lib/action_dispatch/http/response.rb
@@ -44,8 +44,8 @@ module ActionDispatch # :nodoc:
@block = nil
@length = 0
- @status, @header = status, header
- self.body = body
+ @header = header
+ self.body, self.status = body, status
@cookie = []
@sending_file = false
diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb
index be6398fead..ab26d1a645 100644
--- a/actionpack/test/dispatch/response_test.rb
+++ b/actionpack/test/dispatch/response_test.rb
@@ -18,6 +18,10 @@ class ResponseTest < ActiveSupport::TestCase
body.each { |part| parts << part }
assert_equal ["Hello, World!"], parts
end
+
+ test "status handled properly in initialize" do
+ assert_equal 200, ActionDispatch::Response.new('200 OK').status
+ end
test "utf8 output" do
@response.body = [1090, 1077, 1089, 1090].pack("U*")