diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2012-01-26 16:12:20 -0800 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-01-26 16:12:20 -0800 |
commit | f1baf8f5a4fe0dc98b36380498db747d3be5d316 (patch) | |
tree | de763a8d04242148471eb0964b6bff9cece6ef62 /actionpack/test/template/form_helper_test.rb | |
parent | e634efca99962fdbb83791a8daf9b0ceb9ff2f63 (diff) | |
parent | b03e55d17780b4ca9d4b962a426274af1f2e68a6 (diff) | |
download | rails-f1baf8f5a4fe0dc98b36380498db747d3be5d316.tar.gz rails-f1baf8f5a4fe0dc98b36380498db747d3be5d316.tar.bz2 rails-f1baf8f5a4fe0dc98b36380498db747d3be5d316.zip |
Merge pull request #4713 from carlosantoniodasilva/form-label-for
Do not generate label for attribute when giving nil
Diffstat (limited to 'actionpack/test/template/form_helper_test.rb')
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 4 |
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 |