1
0
Fork 0
mirror of https://github.com/heartcombo/simple_form.git synced 2022-11-09 12:19:26 -05:00

provide tests for custom mappings issue

This commit is contained in:
Iurii Plugatariov 2015-02-25 12:31:16 +02:00
parent 98c5413351
commit 46aa123c8c

View file

@ -46,6 +46,17 @@ class FormBuilderTest < ActionView::TestCase
end
end
test 'builder does not override custom input mappings for custom collection' do
swap SimpleForm, input_mappings: { /gender$/ => :check_boxes } do
with_concat_form_for @user do |f|
f.input :gender, collection: [:male, :female]
end
assert_no_select 'select option', 'Male'
assert_select 'input[type=checkbox][value=male]'
end
end
test 'builder allows to skip input_type class' do
swap SimpleForm, generate_additional_classes_for: [:label, :wrapper] do
with_form_for @user, :post_count