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:
parent
4073a73b09
commit
d977e6fbd8
1 changed files with 10 additions and 0 deletions
|
@ -54,6 +54,16 @@ class InputTest < ActionView::TestCase
|
|||
assert_select 'input[type=number].integer#user_age'
|
||||
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
|
||||
with_input_for @other_validating_user, :age, :integer
|
||||
assert_select 'input[min=18]'
|
||||
|
|
Loading…
Reference in a new issue