Move test to a better place

This commit is contained in:
Carlos Antonio da Silva 2012-01-26 11:54:04 -02:00
parent 32952b9132
commit 684d50d9f4
2 changed files with 8 additions and 8 deletions

View File

@ -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'

View File

@ -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'