diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-01 13:39:15 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-01 13:40:14 +0200 |
commit | 46611a995d91abf7bb2a64c62af13b6449c75b07 (patch) | |
tree | 1f2600e1c02142135ec8ea0f5309bb232c0997bf /actionpack/test/controller | |
parent | 6960a230fa2c2b7cf59266fc903ce0c11e887a9f (diff) | |
download | rails-46611a995d91abf7bb2a64c62af13b6449c75b07.tar.gz rails-46611a995d91abf7bb2a64c62af13b6449c75b07.tar.bz2 rails-46611a995d91abf7bb2a64c62af13b6449c75b07.zip |
log errors when an exception happens when streaming.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/new_base/render_streaming_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/new_base/render_streaming_test.rb b/actionpack/test/controller/new_base/render_streaming_test.rb index fed8d40b47..48cf0ab9cb 100644 --- a/actionpack/test/controller/new_base/render_streaming_test.rb +++ b/actionpack/test/controller/new_base/render_streaming_test.rb @@ -83,6 +83,19 @@ module RenderStreaming assert_streaming! end + test "rendering with template exception logs the exception" do + io = StringIO.new + _old, ActionController::Base.logger = ActionController::Base.logger, Logger.new(io) + + begin + get "/render_streaming/basic/template_exception" + io.rewind + assert_match "(undefined method `invalid!' for nil:NilClass)", io.read + ensure + ActionController::Base.logger = _old + end + end + test "do not stream on HTTP/1.0" do get "/render_streaming/basic/hello_world", nil, "HTTP_VERSION" => "HTTP/1.0" assert_body "Hello world, I'm here!" |