Skip to content

Commit

Permalink
add tests for the case where size is explicitly passed to number_fiel…
Browse files Browse the repository at this point in the history
…d helper
  • Loading branch information
vijaydev committed Nov 4, 2011
1 parent 76dedf0 commit cb06727
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions actionpack/test/template/form_helper_test.rb
Expand Up @@ -440,11 +440,15 @@ def test_email_field
def test_number_field
expected = %{<input name="order[quantity]" max="9" id="order_quantity" type="number" min="1" />}
assert_dom_equal(expected, number_field("order", "quantity", :in => 1...10))
expected = %{<input name="order[quantity]" size="30" max="9" id="order_quantity" type="number" min="1" />}
assert_dom_equal(expected, number_field("order", "quantity", :size => 30, :in => 1...10))
end

def test_range_input
expected = %{<input name="hifi[volume]" step="0.1" max="11" id="hifi_volume" type="range" min="0" />}
assert_dom_equal(expected, range_field("hifi", "volume", :in => 0..11, :step => 0.1))
expected = %{<input name="hifi[volume]" step="0.1" size="30" max="11" id="hifi_volume" type="range" min="0" />}
assert_dom_equal(expected, range_field("hifi", "volume", :size => 30, :in => 0..11, :step => 0.1))
end

def test_explicit_name
Expand Down

0 comments on commit cb06727

Please sign in to comment.