aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorChris Hapgood <cch1@hapgoods.com>2009-11-06 17:02:55 -0500
committerEloy Duran <eloy.de.enige@gmail.com>2009-11-07 00:42:07 +0100
commitc2cfb201984f8dff2b3534163b6145fe2560eb80 (patch)
tree3ef9ec588ee8388fdf62d336a55b575960877d80 /actionpack
parentb43964d6061f4a31320906172f763dd3dd188f4d (diff)
downloadrails-c2cfb201984f8dff2b3534163b6145fe2560eb80.tar.gz
rails-c2cfb201984f8dff2b3534163b6145fe2560eb80.tar.bz2
rails-c2cfb201984f8dff2b3534163b6145fe2560eb80.zip
Share ActionView::TestCase's output_buffer with view for concat support.
[#3467 state:resolved] Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/test_case.rb1
-rw-r--r--actionpack/test/template/test_case_test.rb5
2 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb
index 8beda24aba..86bbad822d 100644
--- a/actionpack/lib/action_view/test_case.rb
+++ b/actionpack/lib/action_view/test_case.rb
@@ -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
diff --git a/actionpack/test/template/test_case_test.rb b/actionpack/test/template/test_case_test.rb
index 37dcb86d80..05a409d05a 100644
--- a/actionpack/test/template/test_case_test.rb
+++ b/actionpack/test/template/test_case_test.rb
@@ -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)