Skip to content

Commit

Permalink
Don't leak out minimum or maximum values when MinMax component is in …
Browse files Browse the repository at this point in the history
…use.

It used to emit the last calculated value in bare string just before
label.
  • Loading branch information
julian7 committed Feb 29, 2012
1 parent 42c6052 commit c4db622
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 c4db622

Please sign in to comment.