diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-02 04:05:05 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-02 09:17:54 -0300 |
commit | 7e2ef18b51152ed846f0ee2888bdd63d30c6f6c4 (patch) | |
tree | 4fd17d972486f65475cbb6ca7434d9b816426f74 /actionpack/test | |
parent | 51ab77e9ba3af15f24457e8c64314d0c9a6105ea (diff) | |
download | rails-7e2ef18b51152ed846f0ee2888bdd63d30c6f6c4.tar.gz rails-7e2ef18b51152ed846f0ee2888bdd63d30c6f6c4.tar.bz2 rails-7e2ef18b51152ed846f0ee2888bdd63d30c6f6c4.zip |
Make content_tag_for work without block
This is version of #8640 for master
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/record_tag_helper_test.rb | 8 |
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 a84034c02e..1ba3e70d2c 100644 --- a/actionpack/test/template/record_tag_helper_test.rb +++ b/actionpack/test/template/record_tag_helper_test.rb @@ -75,6 +75,14 @@ class RecordTagHelperTest < ActionView::TestCase assert_dom_equal expected, actual end + def test_content_tag_for_collection_without_given_block + post_1 = RecordTagPost.new.tap { |post| post.id = 101; post.body = "Hello!" } + post_2 = RecordTagPost.new.tap { |post| post.id = 102; post.body = "World!" } + expected = %(<li class="record_tag_post" id="record_tag_post_101"></li>\n<li class="record_tag_post" id="record_tag_post_102"></li>) + actual = content_tag_for(:li, [post_1, post_2]) + assert_dom_equal expected, actual + end + def test_div_for_collection post_1 = RecordTagPost.new { |post| post.id = 101; post.body = "Hello!" } post_2 = RecordTagPost.new { |post| post.id = 102; post.body = "World!" } |