diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/streaming_render_test.rb (renamed from actionpack/test/template/fibered_render_test.rb) | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/actionpack/test/template/fibered_render_test.rb b/actionpack/test/template/streaming_render_test.rb index f62af10812..d6624149d4 100644 --- a/actionpack/test/template/fibered_render_test.rb +++ b/actionpack/test/template/streaming_render_test.rb @@ -5,23 +5,29 @@ require 'controller/fake_models' class TestController < ActionController::Base end - class FiberedTest < ActiveSupport::TestCase - def setup view_paths = ActionController::Base.view_paths @assigns = { :secret => 'in the sauce' } @view = ActionView::Base.new(view_paths, @assigns) - @view.magic_medicine = true @controller_view = TestController.new.view_context end - def test_render_template - assert_equal "Hello world!", @view.render(:template => "test/hello_world") + def buffered_render(options) + body = @view.render_body(options) + string = "" + body.each do |piece| + string << piece + end + string + end + + def test_render_template_without_layout + assert_equal "Hello world!", buffered_render(:template => "test/hello_world") end - def test_render_with_layout + def test_render_template_with_layout assert_equal %(<title></title>\nHello world!\n), - @view.render(:template => "test/hello_world.erb", :layout => "layouts/yield") + buffered_render(:template => "test/hello_world.erb", :layout => "layouts/yield") end end if defined?(Fiber)
\ No newline at end of file |