diff options
Diffstat (limited to 'actionpack/test/template/form_options_helper_test.rb')
-rw-r--r-- | actionpack/test/template/form_options_helper_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb index 3f89a5e426..1db3a4d7d8 100644 --- a/actionpack/test/template/form_options_helper_test.rb +++ b/actionpack/test/template/form_options_helper_test.rb @@ -1300,6 +1300,24 @@ COUNTRIES html end + uses_mocha "time_zone_select_with_priority_zones_as_regexp" do + def test_time_zone_select_with_priority_zones_as_regexp + @firm = Firm.new("D") + MockTimeZone.any_instance.stubs(:=~).returns(true,false,false,true,false) + + html = time_zone_select("firm", "time_zone", /A|D/) + assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" + + "<option value=\"A\">A</option>\n" + + "<option value=\"D\" selected=\"selected\">D</option>" + + "<option value=\"\" disabled=\"disabled\">-------------</option>\n" + + "<option value=\"B\">B</option>\n" + + "<option value=\"C\">C</option>\n" + + "<option value=\"E\">E</option>" + + "</select>", + html + end + end + def test_time_zone_select_with_default_time_zone_and_nil_value @firm = Firm.new() @firm.time_zone = nil |