From db26b47b9f4dbebd478a5fe6c0dcd38b8697939a Mon Sep 17 00:00:00 2001 From: Tom Lea Date: Tue, 26 Aug 2008 11:08:31 +0100 Subject: Ensure that calling content_tag_for in a helper doesn't cause duplicate output. Signed-off-by: Michael Koziarski [#871 state:committed] --- actionpack/test/template/record_tag_helper_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/record_tag_helper_test.rb b/actionpack/test/template/record_tag_helper_test.rb index 34a200b933..67aa047745 100644 --- a/actionpack/test/template/record_tag_helper_test.rb +++ b/actionpack/test/template/record_tag_helper_test.rb @@ -34,6 +34,14 @@ class RecordTagHelperTest < ActionView::TestCase assert_dom_equal expected, actual end + def test_block_not_in_erb_multiple_calls + expected = %(
#{@post.body}
) + actual = div_for(@post, :class => "bar") { @post.body } + assert_dom_equal expected, actual + actual = div_for(@post, :class => "bar") { @post.body } + assert_dom_equal expected, actual + end + def test_block_works_with_content_tag_for_in_erb __in_erb_template = '' expected = %(#{@post.body}) -- cgit v1.2.3