@@ -120,6 +120,13 @@ def test_label_with_locales_symbols
120
120
I18n . locale = old_locale
121
121
end
122
122
123
+ def test_label_with_locales_and_options
124
+ old_locale , I18n . locale = I18n . locale , :label
125
+ assert_dom_equal ( '<label for="post_body" class="post_body">Write entire text here</label>' , label ( :post , :body , :class => 'post_body' ) )
126
+ ensure
127
+ I18n . locale = old_locale
128
+ end
129
+
123
130
def test_label_with_for_attribute_as_symbol
124
131
assert_dom_equal ( '<label for="my_for">Title</label>' , label ( :post , :title , nil , :for => "my_for" ) )
125
132
end
@@ -620,15 +627,15 @@ def test_form_for
620
627
621
628
def test_form_for_with_symbol_object_name
622
629
form_for ( @post , :as => "other_name" , :html => { :id => 'create-post' } ) do |f |
623
- concat f . label ( :title )
630
+ concat f . label ( :title , :class => 'post_title' )
624
631
concat f . text_field ( :title )
625
632
concat f . text_area ( :body )
626
633
concat f . check_box ( :secret )
627
634
concat f . submit ( 'Create post' )
628
635
end
629
636
630
637
expected = whole_form ( "/posts/123" , "create-post" , "other_name_edit" , :method => "put" ) do
631
- "<label for='other_name_title'>Title</label>" +
638
+ "<label for='other_name_title' class='post_title' >Title</label>" +
632
639
"<input name='other_name[title]' size='30' id='other_name_title' value='Hello World' type='text' />" +
633
640
"<textarea name='other_name[body]' id='other_name_body' rows='20' cols='40'>Back to the hill and over it again!</textarea>" +
634
641
"<input name='other_name[secret]' value='0' type='hidden' />" +
0 commit comments