Setting custom field_error_proc test
This commit is contained in:
parent
1c886ff653
commit
7561a014da
|
@ -139,7 +139,7 @@ module SimpleForm
|
|||
mattr_accessor :button_class
|
||||
@@button_class = 'button'
|
||||
|
||||
# Override the default ActiveRecordHelper behaviour of wrapping the input.
|
||||
# Override the default ActiveModelHelper behaviour of wrapping the input.
|
||||
# This gets taken care of semantically by adding an error class to the wrapper tag
|
||||
# containing the input.
|
||||
mattr_accessor :field_error_proc
|
||||
|
|
|
@ -131,6 +131,13 @@ class FormHelperTest < ActionView::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
test 'custom field error proc' do
|
||||
expected_error_proc = lambda {}
|
||||
swap SimpleForm, field_error_proc: expected_error_proc do
|
||||
assert_equal expected_error_proc, SimpleForm.field_error_proc
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def swap_field_error_proc(expected_error_proc = lambda {})
|
||||
|
|
Loading…
Reference in New Issue