From 53d68bd964af17484898c5cd5e21a8ce9c359143 Mon Sep 17 00:00:00 2001 From: Brian McManus Date: Wed, 27 Mar 2013 14:08:18 -0700 Subject: Add regression test for TZ grep Added a regression test that will fail if anyone tries to change time_zone_select to use grep again thinking it will work when it does not. --- actionpack/test/template/form_options_helper_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'actionpack') diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb index de806d7bdb..0b45d01593 100644 --- a/actionpack/test/template/form_options_helper_test.rb +++ b/actionpack/test/template/form_options_helper_test.rb @@ -1110,6 +1110,26 @@ class FormOptionsHelperTest < ActionView::TestCase "", html end + + def test_time_zone_select_with_priority_zones_as_regexp_using_grep_finds_no_zones + @firm = Firm.new("D") + + priority_zones = /A|D/ + @fake_timezones.each_with_index do |tz, i| + priority_zones.stubs(:===).with(tz).raises(Exception) + end + + html = time_zone_select("firm", "time_zone", priority_zones) + assert_dom_equal "", + html + end def test_time_zone_select_with_default_time_zone_and_nil_value @firm = Firm.new() -- cgit v1.2.3