Permalink
Browse files

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

[#3467 state:resolved]

Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
  • Loading branch information...
1 parent b43964d commit c2cfb201984f8dff2b3534163b6145fe2560eb80 @cch1 cch1 committed with alloy Nov 6, 2009
Showing with 6 additions and 0 deletions.
  1. +1 −0 actionpack/lib/action_view/test_case.rb
  2. +5 −0 actionpack/test/template/test_case_test.rb
@@ -120,6 +120,7 @@ def make_test_case_available_to_view!
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
@@ -38,6 +38,11 @@ class GeneralViewTest < ActionView::TestCase
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)

0 comments on commit c2cfb20

Please sign in to comment.