Skip to content

Commit

Permalink
Merge pull request heartcombo#484 from julian7/minmax_barestring
Browse files Browse the repository at this point in the history
Don't leak out minimum or maximum values when MinMax component is in use
  • Loading branch information
carlosantoniodasilva committed Mar 1, 2012
2 parents 42c6052 + c4db622 commit e067d8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/simple_form/components/min_max.rb
Expand Up @@ -7,6 +7,7 @@ def min_max
input_html_options[:min] ||= minimum_value(validator_options)
input_html_options[:max] ||= maximum_value(validator_options)
end
nil
end

private
Expand Down
6 changes: 6 additions & 0 deletions test/inputs/numeric_input_test.rb
Expand Up @@ -164,4 +164,10 @@ class NumericInputTest < ActionView::TestCase
assert_select 'input[max=99]'
end
end

test 'min_max should not emit max value as bare string' do
with_input_for @other_validating_user, :age, :integer
assert_select 'div', {:count => 0, :text => %r{^99}}
end

end

0 comments on commit e067d8d

Please sign in to comment.