aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorTom Lea <contrib@tomlea.co.uk>2008-08-26 11:08:31 +0100
committerMichael Koziarski <michael@koziarski.com>2008-08-29 20:52:01 +0200
commitdb26b47b9f4dbebd478a5fe6c0dcd38b8697939a (patch)
tree7312c03896fef70832bb116c0f644bbb222b3c9e /actionpack/test
parentd0b949d87375ae351757adffd192d8cb1f3dbf8d (diff)
downloadrails-db26b47b9f4dbebd478a5fe6c0dcd38b8697939a.tar.gz
rails-db26b47b9f4dbebd478a5fe6c0dcd38b8697939a.tar.bz2
rails-db26b47b9f4dbebd478a5fe6c0dcd38b8697939a.zip
Ensure that calling content_tag_for in a helper doesn't cause duplicate output.
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#871 state:committed]
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/record_tag_helper_test.rb8
1 files changed, 8 insertions, 0 deletions
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 = %(<div class="post bar" id="post_45">#{@post.body}</div>)
+ 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 = %(<tr class="post" id="post_45">#{@post.body}</tr>)