Move test to a better place
This commit is contained in:
parent
32952b9132
commit
684d50d9f4
|
@ -295,14 +295,6 @@ class CollectionInputTest < ActionView::TestCase
|
|||
assert_select 'select[required]'
|
||||
end
|
||||
|
||||
test 'when not using browser validations, input should not generate required html attribute' do
|
||||
swap SimpleForm, :browser_validations => false do
|
||||
with_input_for @user, :name, :string
|
||||
assert_select 'input[type=text].required'
|
||||
assert_no_select 'input[type=text][required]'
|
||||
end
|
||||
end
|
||||
|
||||
test 'collection input with select type should not generate required html attribute without blank option' do
|
||||
with_input_for @user, :name, :select, :include_blank => false, :collection => ['Jose' , 'Carlos']
|
||||
assert_select 'select.required'
|
||||
|
|
|
@ -29,6 +29,14 @@ class RequiredTest < ActionView::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
test 'when not using browser validations, input should not generate required html attribute' do
|
||||
swap SimpleForm, :browser_validations => false do
|
||||
with_input_for @user, :name, :string
|
||||
assert_select 'input[type=text].required'
|
||||
assert_no_select 'input[type=text][required]'
|
||||
end
|
||||
end
|
||||
|
||||
test 'builder input should allow disabling required when ActiveModel::Validations is not included' do
|
||||
with_form_for @user, :name, :required => false
|
||||
assert_no_select 'input.required'
|
||||
|
|
Loading…
Reference in New Issue