Add tests to make sure that nested radian style do not generate invalid html

This commit is contained in:
Ricardo de Cillo 2014-03-26 22:16:40 -03:00
parent 857a3fc583
commit f24c3d9e73
1 changed files with 8 additions and 0 deletions

View File

@ -26,6 +26,14 @@ class CollectionRadioButtonsInputTest < ActionView::TestCase
end
end
test 'nested label should not duplicate input id' do
swap SimpleForm, boolean_style: :nested do
with_input_for @user, :active, :radio_buttons, id: 'nested_id'
assert_select 'input#user_active_true'
assert_no_select 'label#user_active_true'
end
end
test 'input as radio should use i18n to translate internal labels' do
store_translations(:en, simple_form: { yes: 'Sim', no: 'Não' }) do
with_input_for @user, :active, :radio_buttons