aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorjasl <jasl9187@hotmail.com>2013-01-02 16:48:09 +0800
committerjasl <jasl9187@hotmail.com>2013-01-02 16:48:09 +0800
commitea881ca85a1a9df3c25e2ee8668d98416a5c1acb (patch)
tree89cdf15778c579012e4453c4c6c9c358feee94f4 /actionpack/test
parentd38c8caa48a732d41c7402a5e71deece4e313559 (diff)
downloadrails-ea881ca85a1a9df3c25e2ee8668d98416a5c1acb.tar.gz
rails-ea881ca85a1a9df3c25e2ee8668d98416a5c1acb.tar.bz2
rails-ea881ca85a1a9df3c25e2ee8668d98416a5c1acb.zip
fix block.arity raise nil error when not given a block to "content_tag_for"
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 f33471ab28..3cb5997a83 100644
--- a/actionpack/test/template/record_tag_helper_test.rb
+++ b/actionpack/test/template/record_tag_helper_test.rb
@@ -81,6 +81,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.persisted = true }
+ post_2 = RecordTagPost.new.tap { |post| post.id = 102; post.body = "World!"; post.persisted = true }
+ 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.tap { |post| post.id = 101; post.body = "Hello!"; post.persisted = true }
post_2 = RecordTagPost.new.tap { |post| post.id = 102; post.body = "World!"; post.persisted = true }