aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/response_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-06-15 17:54:08 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-06-15 17:54:08 -0700
commit50176b59fa3a5110d7b9ebdbc49852e30b130736 (patch)
tree05dc0d6f754defa2c8ab2322c5880c399531fcdf /actionpack/test/dispatch/response_test.rb
parentdd8c76d9b90da5c1b551e26c7d27d9519a19b711 (diff)
downloadrails-50176b59fa3a5110d7b9ebdbc49852e30b130736.tar.gz
rails-50176b59fa3a5110d7b9ebdbc49852e30b130736.tar.bz2
rails-50176b59fa3a5110d7b9ebdbc49852e30b130736.zip
remove `header=` on the response object.
People should be free to mutate the header object, but not to set a new header object. That header object may be specific to the webserver, and we need to hide it's internals.
Diffstat (limited to 'actionpack/test/dispatch/response_test.rb')
-rw-r--r--actionpack/test/dispatch/response_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb
index 5fbd19acdf..7aca251066 100644
--- a/actionpack/test/dispatch/response_test.rb
+++ b/actionpack/test/dispatch/response_test.rb
@@ -72,12 +72,14 @@ class ResponseTest < ActiveSupport::TestCase
test "content type" do
[204, 304].each do |c|
+ @response = ActionDispatch::Response.new
@response.status = c.to_s
_, headers, _ = @response.to_a
assert !headers.has_key?("Content-Type"), "#{c} should not have Content-Type header"
end
[200, 302, 404, 500].each do |c|
+ @response = ActionDispatch::Response.new
@response.status = c.to_s
_, headers, _ = @response.to_a
assert headers.has_key?("Content-Type"), "#{c} did not have Content-Type header"