Improve wrapper test for c82574

This test is able to cover changes from c82574.
This commit is contained in:
Felipe Renan 2020-02-06 20:33:17 +02:00
parent ac5759cb80
commit 224d5c6eb6
1 changed files with 4 additions and 6 deletions

View File

@ -60,12 +60,10 @@ class WrapperTest < ActionView::TestCase
end end
test 'wrapper does not determine if valid class is needed when it is set to nil' do test 'wrapper does not determine if valid class is needed when it is set to nil' do
def @user.name; raise BOOM; end @user.instance_eval { undef errors }
with_form_for @user, :name, as: :file, wrapper: custom_wrapper_with_input_valid_class(valid_class: nil) with_form_for @user, :name, wrapper: custom_wrapper_with_input_valid_class(valid_class: nil)
assert_select 'div'
assert_select 'input' assert_no_select 'div.field_without_errors'
assert_no_select 'div.field_with_errors'
assert_no_select 'input.is-invalid'
end end
test 'wrapper adds hint class for attribute with a hint' do test 'wrapper adds hint class for attribute with a hint' do