1
0
Fork 0
mirror of https://github.com/heartcombo/simple_form.git synced 2022-11-09 12:19:26 -05:00

Assert that the min and max attributes are only added when needed

This commit is contained in:
Daniel Schierbeck 2010-09-09 01:17:58 +08:00 committed by Carlos Antonio da Silva
parent 4073a73b09
commit d977e6fbd8

View file

@ -54,6 +54,16 @@ class InputTest < ActionView::TestCase
assert_select 'input[type=number].integer#user_age' assert_select 'input[type=number].integer#user_age'
end end
test 'input should be default not have a min attr' do
with_input_for @user, :age, :integer
assert_select 'input[min]', :count => 0
end
test 'input should be default not have a max attr' do
with_input_for @user, :age, :integer
assert_select 'input[max]', :count => 0
end
test 'input should infer the min attr from a > validation' do test 'input should infer the min attr from a > validation' do
with_input_for @other_validating_user, :age, :integer with_input_for @other_validating_user, :age, :integer
assert_select 'input[min=18]' assert_select 'input[min=18]'