1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

added test for number_to_phone with an empty string and area code true

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
Diego Carrion 2011-04-20 14:26:45 -03:00 committed by Santiago Pastorino
parent 12427c8dea
commit 873c13fc0d

View file

@ -32,6 +32,7 @@ class NumberHelperTest < ActionView::TestCase
assert_equal("555-1234", number_to_phone(5551234)) assert_equal("555-1234", number_to_phone(5551234))
assert_equal("800-555-1212", number_to_phone(8005551212)) assert_equal("800-555-1212", number_to_phone(8005551212))
assert_equal("(800) 555-1212", number_to_phone(8005551212, {:area_code => true})) assert_equal("(800) 555-1212", number_to_phone(8005551212, {:area_code => true}))
assert_equal("", number_to_phone("", {:area_code => true}))
assert_equal("800 555 1212", number_to_phone(8005551212, {:delimiter => " "})) assert_equal("800 555 1212", number_to_phone(8005551212, {:delimiter => " "}))
assert_equal("(800) 555-1212 x 123", number_to_phone(8005551212, {:area_code => true, :extension => 123})) assert_equal("(800) 555-1212 x 123", number_to_phone(8005551212, {:area_code => true, :extension => 123}))
assert_equal("800-555-1212", number_to_phone(8005551212, :extension => " ")) assert_equal("800-555-1212", number_to_phone(8005551212, :extension => " "))