Add label text to collection radio / check boxes as well
This commit is contained in:
parent
51a816e904
commit
9fb217b7b0
|
@ -34,7 +34,7 @@ module SimpleForm
|
|||
return unless nested_boolean_style?
|
||||
|
||||
proc do |label_for, text, value, html_options|
|
||||
@builder.label(label_for, text) { nested_boolean_style_item_tag(value, html_options) }
|
||||
@builder.label(label_for) { nested_boolean_style_item_tag(value, html_options) + text }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -159,7 +159,9 @@ class CollectionCheckBoxesInputTest < ActionView::TestCase
|
|||
with_input_for @user, :active, :check_boxes
|
||||
|
||||
assert_select 'label[for=user_active_true] > input#user_active_true[type=checkbox]'
|
||||
assert_select 'label[for=user_active_true]', 'Yes'
|
||||
assert_select 'label[for=user_active_false] > input#user_active_false[type=checkbox]'
|
||||
assert_select 'label[for=user_active_false]', 'No'
|
||||
assert_no_select 'label.collection_radio'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -252,7 +252,9 @@ class CollectionRadioInputTest < ActionView::TestCase
|
|||
with_input_for @user, :active, :radio
|
||||
|
||||
assert_select 'label[for=user_active_true] > input#user_active_true[type=radio]'
|
||||
assert_select 'label[for=user_active_true]', 'Yes'
|
||||
assert_select 'label[for=user_active_false] > input#user_active_false[type=radio]'
|
||||
assert_select 'label[for=user_active_false]', 'No'
|
||||
assert_no_select 'label.collection_radio'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue