mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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:
committed by
Eloy Duran
parent
b43964d606
commit
c2cfb20198
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user