aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-01-26 20:46:43 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-01-26 21:23:33 -0200
commitb03e55d17780b4ca9d4b962a426274af1f2e68a6 (patch)
treede763a8d04242148471eb0964b6bff9cece6ef62 /actionpack/test/template
parente634efca99962fdbb83791a8daf9b0ceb9ff2f63 (diff)
downloadrails-b03e55d17780b4ca9d4b962a426274af1f2e68a6.tar.gz
rails-b03e55d17780b4ca9d4b962a426274af1f2e68a6.tar.bz2
rails-b03e55d17780b4ca9d4b962a426274af1f2e68a6.zip
Do not generate label for attribute when giving nil
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/form_helper_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index 39d4768861..8680631a48 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -215,6 +215,10 @@ class FormHelperTest < ActionView::TestCase
assert_dom_equal('<label for="my_for">Title</label>', label(:post, :title, nil, "for" => "my_for"))
end
+ def test_label_does_not_generate_for_attribute_when_given_nil
+ assert_dom_equal('<label>Title</label>', label(:post, :title, :for => nil))
+ end
+
def test_label_with_id_attribute_as_symbol
assert_dom_equal('<label for="post_title" id="my_id">Title</label>', label(:post, :title, nil, :id => "my_id"))
end