From 3e0aedba909562411b8f369115828a79a7a77a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 16 Apr 2011 11:22:36 +0200 Subject: Add more tests, ensure we never yield outside the fiber context and that we swap buffers when moving from parent to child. --- actionpack/test/template/streaming_render_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/streaming_render_test.rb b/actionpack/test/template/streaming_render_test.rb index 06669bb1ee..754ede9701 100644 --- a/actionpack/test/template/streaming_render_test.rb +++ b/actionpack/test/template/streaming_render_test.rb @@ -86,4 +86,12 @@ class FiberedTest < ActiveSupport::TestCase def test_render_with_handler_without_streaming_support assert_match "

This is grand!

", buffered_render(:template => "test/hello") end + + def test_render_with_streaming_multiple_yields_provide_and_content_for + assert_equal "Yes, \nthis works\n like a charm.", buffered_render(:template => "test/streaming", :layout => "layouts/streaming") + end + + def test_render_with_streaming_with_fake_yields_and_streaming_buster + assert_equal "This won't look\n good.", buffered_render(:template => "test/streaming_buster", :layout => "layouts/streaming") + end end if defined?(Fiber) \ No newline at end of file -- cgit v1.2.3