aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-07-29 20:26:40 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-07-29 21:43:07 -0700
commit4509494f702d58852ad47488ee1496dd34e31149 (patch)
treeec37229daf4c123764c2e9db9c63e49e714d7276 /actionpack/test
parentb3d1f5b630debcc2d0572a3e3af1855ef93300c2 (diff)
downloadrails-4509494f702d58852ad47488ee1496dd34e31149.tar.gz
rails-4509494f702d58852ad47488ee1496dd34e31149.tar.bz2
rails-4509494f702d58852ad47488ee1496dd34e31149.zip
header hash is duped before being sent up the rack stack
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/live_stream_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/live_stream_test.rb b/actionpack/test/controller/live_stream_test.rb
index e5fb50fca4..74b223e4f5 100644
--- a/actionpack/test/controller/live_stream_test.rb
+++ b/actionpack/test/controller/live_stream_test.rb
@@ -12,6 +12,11 @@ module ActionController
'test'
end
+ def default_header
+ response.stream.write "<html><body>hi</body></html>"
+ response.stream.close
+ end
+
def basic_stream
response.headers['Content-Type'] = 'text/event-stream'
%w{ hello world }.each do |word|
@@ -94,5 +99,13 @@ module ActionController
get :thread_locals
end
+
+ def test_live_stream_default_header
+ @controller.request = @request
+ @controller.response = @response
+ @controller.process :default_header
+ _, headers, _ = @response.prepare!
+ assert headers['Content-Type']
+ end
end
end