Share ActionView::TestCase's output_buffer with view for concat support.

[#3467 state:resolved]

Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
This commit is contained in:
Chris Hapgood
2009-11-06 17:02:55 -05:00
committed by Eloy Duran
parent b43964d606
commit c2cfb20198
2 changed files with 6 additions and 0 deletions

View File

@@ -120,6 +120,7 @@ module ActionView
def _view
view = ActionView::Base.new(ActionController::Base.view_paths, _assigns, @controller)
view.class.send :include, _helpers
view.output_buffer = self.output_buffer
view
end

View File

@@ -38,6 +38,11 @@ module ActionView
assert_equal 'Eloy', render('developers/developer', :developer => stub(:name => 'Eloy'))
end
test "can render a layout with block" do
assert_equal "Before (ChrisCruft)\n!\nAfter",
render(:layout => "test/layout_for_partial", :locals => {:name => "ChrisCruft"}) {"!"}
end
helper AnotherTestHelper
test "additional helper classes can be specified as in a controller" do
assert test_case.ancestors.include?(AnotherTestHelper)