Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

The magic medicine worked.

  • Loading branch information...
commit 62668cccb9a288b0cd6f6dd49df71661164be2c4 1 parent e30ca00
@josevalim josevalim authored
View
2  actionpack/lib/action_view/base.rb
@@ -153,7 +153,7 @@ def cache_template_loading=(value)
end
end
- attr_accessor :_template, :_view_flow, :magic_medicine
+ attr_accessor :_template, :_view_flow
attr_internal :request, :controller, :config, :assigns, :lookup_context
delegate :formats, :formats=, :locale, :locale=, :view_paths, :view_paths=, :to => :lookup_context
View
20 actionpack/test/template/fibered_render_test.rb → actionpack/test/template/streaming_render_test.rb
@@ -5,23 +5,29 @@
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)
Please sign in to comment.
Something went wrong with that request. Please try again.