diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-03-01 16:20:27 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-03-01 16:20:27 +0900 |
commit | 35d12ef3f15184c45b51bfab9b399fe73a7a3ce3 (patch) | |
tree | db1e62352dd05bcb56f36a61699e7f06d14aa2bf /actionview/test | |
parent | 22e0a22d5f98e162290d9820891d8191e720ad3b (diff) | |
download | rails-35d12ef3f15184c45b51bfab9b399fe73a7a3ce3.tar.gz rails-35d12ef3f15184c45b51bfab9b399fe73a7a3ce3.tar.bz2 rails-35d12ef3f15184c45b51bfab9b399fe73a7a3ce3.zip |
fix ActionView::Template::Error when using Streaming with capture.
can't acquire a encoding from StreamingBuffer. fixes #12001
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/fixtures/layouts/streaming_with_capture.erb | 6 | ||||
-rw-r--r-- | actionview/test/template/streaming_render_test.rb | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/actionview/test/fixtures/layouts/streaming_with_capture.erb b/actionview/test/fixtures/layouts/streaming_with_capture.erb new file mode 100644 index 0000000000..538c19ce3a --- /dev/null +++ b/actionview/test/fixtures/layouts/streaming_with_capture.erb @@ -0,0 +1,6 @@ +<%= yield :header -%> +<%= capture do %> + this works +<% end %> +<%= yield :footer -%> +<%= yield(:unknown).presence || "." -%> diff --git a/actionview/test/template/streaming_render_test.rb b/actionview/test/template/streaming_render_test.rb index ec537775be..d06ba4ceb0 100644 --- a/actionview/test/template/streaming_render_test.rb +++ b/actionview/test/template/streaming_render_test.rb @@ -104,4 +104,8 @@ class FiberedTest < ActiveSupport::TestCase buffered_render(:template => "test/nested_streaming", :layout => "layouts/streaming") end + def test_render_with_streaming_and_capture + assert_equal "Yes, \n this works\n like a charm.", + buffered_render(template: "test/streaming", layout: "layouts/streaming_with_capture") + end end |