Skip to content

Commit

Permalink
Improve wrapper test for c82574
Browse files Browse the repository at this point in the history
This test is able to cover changes from c82574.
  • Loading branch information
feliperenan committed Feb 6, 2020
1 parent ac5759c commit 224d5c6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/form_builder/wrapper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ class WrapperTest < ActionView::TestCase
end

test 'wrapper does not determine if valid class is needed when it is set to nil' do
def @user.name; raise BOOM; end
with_form_for @user, :name, as: :file, wrapper: custom_wrapper_with_input_valid_class(valid_class: nil)
assert_select 'div'
assert_select 'input'
assert_no_select 'div.field_with_errors'
assert_no_select 'input.is-invalid'
@user.instance_eval { undef errors }
with_form_for @user, :name, wrapper: custom_wrapper_with_input_valid_class(valid_class: nil)

assert_no_select 'div.field_without_errors'
end

test 'wrapper adds hint class for attribute with a hint' do
Expand Down

0 comments on commit 224d5c6

Please sign in to comment.