diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-02-14 21:51:18 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-02-14 21:53:38 -0200 |
commit | 7c79996c6754f6d7dd67f43d279a63121ee71a9b (patch) | |
tree | 3932edf8c25e30b8449d7e334ad559f21ed83cf1 /actionpack/test | |
parent | 5f9a5a51deb3c7f41993c4a3e7fa5cbbf342113f (diff) | |
download | rails-7c79996c6754f6d7dd67f43d279a63121ee71a9b.tar.gz rails-7c79996c6754f6d7dd67f43d279a63121ee71a9b.tar.bz2 rails-7c79996c6754f6d7dd67f43d279a63121ee71a9b.zip |
Rack body respond to each and not to join
This fixes undef `to_str' for Rack::Chunked::Body when using
caches_action + streaming on an action
Closes #5027
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 443b56830a..02b092ea8f 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -237,6 +237,7 @@ class ActionCachingTestController < CachingController caches_action :with_format_and_http_param, :cache_path => Proc.new { |c| { :key => 'value' } } caches_action :layout_false, :layout => false caches_action :record_not_found, :four_oh_four, :simple_runtime_error + caches_action :streaming layout 'talk_from_action' @@ -296,6 +297,10 @@ class ActionCachingTestController < CachingController expire_action url_for(:controller => 'action_caching_test', :action => 'index') render :nothing => true end + + def streaming + render :text => "streaming", :stream => true + end end class MockTime < Time @@ -647,6 +652,13 @@ class ActionCacheTest < ActionController::TestCase assert_response 500 end + def test_action_caching_plus_streaming + get :streaming + assert_response :success + assert_match(/streaming/, @response.body) + assert fragment_exist?('hostname.com/action_caching_test/streaming') + end + private def content_to_cache assigns(:cache_this) |