Skip to content
This repository
Browse code

add tests for the case where size is explicitly passed to number_fiel…

…d helper
  • Loading branch information...
commit cb06727b6cb7310808f5b9ce1bf254055806ba80 1 parent 76dedf0
Vijay Dev authored November 04, 2011
4  actionpack/test/template/form_helper_test.rb
@@ -440,11 +440,15 @@ def test_email_field
440 440
   def test_number_field
441 441
     expected = %{<input name="order[quantity]" max="9" id="order_quantity" type="number" min="1" />}
442 442
     assert_dom_equal(expected, number_field("order", "quantity", :in => 1...10))
  443
+    expected = %{<input name="order[quantity]" size="30" max="9" id="order_quantity" type="number" min="1" />}
  444
+    assert_dom_equal(expected, number_field("order", "quantity", :size => 30, :in => 1...10))
443 445
   end
444 446
 
445 447
   def test_range_input
446 448
     expected = %{<input name="hifi[volume]" step="0.1" max="11" id="hifi_volume" type="range" min="0" />}
447 449
     assert_dom_equal(expected, range_field("hifi", "volume", :in => 0..11, :step => 0.1))
  450
+    expected = %{<input name="hifi[volume]" step="0.1" size="30" max="11" id="hifi_volume" type="range" min="0" />}
  451
+    assert_dom_equal(expected, range_field("hifi", "volume", :size => 30, :in => 0..11, :step => 0.1))
448 452
   end
449 453
 
450 454
   def test_explicit_name

0 notes on commit cb06727

Please sign in to comment.
Something went wrong with that request. Please try again.