mirror of
https://github.com/heartcombo/simple_form.git
synced 2022-11-09 12:19:26 -05:00
Fixes test for required label
This commit is contained in:
parent
1231fb1662
commit
8663fae306
2 changed files with 2 additions and 2 deletions
|
@ -55,7 +55,7 @@ module SimpleForm
|
|||
end
|
||||
|
||||
def attribute_required?
|
||||
if options.key?(:required)
|
||||
if !options[:required].nil?
|
||||
options[:required]
|
||||
elsif has_validators?
|
||||
(attribute_validators + reflection_validators).any? { |v| v.kind == :presence }
|
||||
|
|
|
@ -386,7 +386,7 @@ class FormBuilderTest < ActionView::TestCase
|
|||
|
||||
test 'builder should add a required class to label if the attribute is required' do
|
||||
with_label_for @validating_user, :name
|
||||
assert_select 'label.string[for=validating_user_name]', /Name/
|
||||
assert_select 'label.string.required[for=validating_user_name]', /Name/
|
||||
end
|
||||
|
||||
test 'builder should allow passing options to label tag' do
|
||||
|
|
Loading…
Reference in a new issue