diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-23 14:39:45 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-23 15:48:01 -0700 |
commit | e16afe61abd78c55f80752ca020b90d59ae1940f (patch) | |
tree | 9d7d55fa0da6bce1234367b634ae1a48aec88112 /actionpack/test | |
parent | 28cb10b15e8950ff21a26c8849e55d5ca3c25d6b (diff) | |
download | rails-e16afe61abd78c55f80752ca020b90d59ae1940f.tar.gz rails-e16afe61abd78c55f80752ca020b90d59ae1940f.tar.bz2 rails-e16afe61abd78c55f80752ca020b90d59ae1940f.zip |
stop applying default headers in ActionDispatch::Response
I'm making this change so that I can construct response objects that
*don't* have the default headers applied. For example, I would like to
construct a response object from the return value of a controller.
If you need to construct a response object with the default headers,
then please use the alternate constructor:
`ActionDispatch::Response.create`
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/response_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb index 795d036e20..85cdcda655 100644 --- a/actionpack/test/dispatch/response_test.rb +++ b/actionpack/test/dispatch/response_test.rb @@ -4,7 +4,7 @@ require 'rack/content_length' class ResponseTest < ActiveSupport::TestCase def setup - @response = ActionDispatch::Response.new + @response = ActionDispatch::Response.create end def test_can_wait_until_commit @@ -217,7 +217,7 @@ class ResponseTest < ActiveSupport::TestCase 'X-Content-Type-Options' => 'nosniff', 'X-XSS-Protection' => '1;' } - resp = ActionDispatch::Response.new.tap { |response| + resp = ActionDispatch::Response.create.tap { |response| response.body = 'Hello' } resp.to_a @@ -236,7 +236,7 @@ class ResponseTest < ActiveSupport::TestCase ActionDispatch::Response.default_headers = { 'X-XX-XXXX' => 'Here is my phone number' } - resp = ActionDispatch::Response.new.tap { |response| + resp = ActionDispatch::Response.create.tap { |response| response.body = 'Hello' } resp.to_a |