Rename fieldWithErrors css class to field_with_errors
This commit is contained in:
parent
beeabda97a
commit
25cc5b1e01
|
@ -24,7 +24,7 @@ SimpleForm.setup do |config|
|
|||
# config.wrapper_class = :input
|
||||
|
||||
# CSS class to add to the wrapper if the field has errors.
|
||||
# config.wrapper_error_class = :fieldWithErrors
|
||||
# config.wrapper_error_class = :field_with_errors
|
||||
|
||||
# How the label text should be generated altogether with the required text.
|
||||
# config.label_text = lambda { |label, required| "#{required} #{label}" }
|
||||
|
|
|
@ -48,7 +48,7 @@ module SimpleForm
|
|||
|
||||
# You can define the class to add to the wrapper when the field has errors. Default is fieldWithErrors.
|
||||
mattr_accessor :wrapper_error_class
|
||||
@@wrapper_error_class = :fieldWithErrors
|
||||
@@wrapper_error_class = :field_with_errors
|
||||
|
||||
# How the label text should be generated altogether with the required text.
|
||||
mattr_accessor :label_text
|
||||
|
|
|
@ -16,17 +16,17 @@ class WrapperTest < ActionView::TestCase
|
|||
|
||||
test 'wrapper should not have error class for attribute without errors' do
|
||||
with_error_for @user, :active
|
||||
assert_no_select 'div.fieldWithErrors'
|
||||
assert_no_select 'div.field_with_errors'
|
||||
end
|
||||
|
||||
test 'wrapper should not have error class when object is not present' do
|
||||
with_error_for :project, :name
|
||||
assert_no_select 'div.fieldWithErrors'
|
||||
assert_no_select 'div.field_with_errors'
|
||||
end
|
||||
|
||||
test 'wrapper should add error class for attribute with errors' do
|
||||
with_error_for @user, :name
|
||||
assert_select 'div.fieldWithErrors'
|
||||
assert_select 'div.field_with_errors'
|
||||
end
|
||||
|
||||
test 'wrapper should add chosen error class for attribute with errors' do
|
||||
|
|
|
@ -305,7 +305,7 @@ class FormBuilderTest < ActionView::TestCase
|
|||
|
||||
test 'builder wrapping tag adds errors class for attribute with errors' do
|
||||
with_form_for @user, :name
|
||||
assert_select 'form div.input.required.string.fieldWithErrors'
|
||||
assert_select 'form div.input.required.string.field_with_errors'
|
||||
end
|
||||
|
||||
# WITHOUT OBJECT
|
||||
|
|
Loading…
Reference in New Issue