From 540ebe37cd1a9551b739c552a0d4efd2adc7ff22 Mon Sep 17 00:00:00 2001 From: Semyon Perepelitsa Date: Thu, 24 Jan 2013 04:26:49 +0800 Subject: Fix `content_tag_for` with array html option. It would embed array as string instead of joining it like `content_tag` does: content_tag(:td, class: ["foo", "bar"]){} #=> '' Before: content_tag_for(:td, item, class: ["foo", "bar"]){} #=> '' After: content_tag_for(:td, item, class: ["foo", "bar"]){} #=> '' --- actionpack/test/template/record_tag_helper_test.rb | 6 ++++++ 1 file changed, 6 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 9c49438f6a..ab84bccb56 100644 --- a/actionpack/test/template/record_tag_helper_test.rb +++ b/actionpack/test/template/record_tag_helper_test.rb @@ -41,6 +41,12 @@ class RecordTagHelperTest < ActionView::TestCase assert_dom_equal expected, actual end + def test_content_tag_for_with_array_css_class + expected = %() + actual = content_tag_for(:tr, @post, class: ["special", "odd"]) + assert_dom_equal expected, actual + end + def test_content_tag_for_with_prefix_and_extra_html_options expected = %() actual = content_tag_for(:tr, @post, :archived, class: "special", style: "background-color: #f0f0f0") -- cgit v1.2.3