Add a test case for boolean input with include_hidden: false and single wrapper.
This commit is contained in:
parent
515db9acb3
commit
1b3e91036a
|
@ -154,6 +154,14 @@ class BooleanInputTest < ActionView::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
test 'input with nested style and with single wrapper allows disabling hidden field' do
|
||||
swap SimpleForm, boolean_style: :nested do
|
||||
with_input_for @user, :active, :boolean, include_hidden: false, wrapper: custom_wrapper_with_wrapped_label_input
|
||||
assert_select "label.boolean > input.boolean"
|
||||
assert_no_select "input[type=hidden] + label.boolean"
|
||||
end
|
||||
end
|
||||
|
||||
test 'input with nested style does not include hidden field when unchecked_value is false' do
|
||||
swap SimpleForm, boolean_style: :nested do
|
||||
with_input_for @user, :active, :boolean, unchecked_value: false
|
||||
|
|
Loading…
Reference in New Issue