diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-11-22 16:15:46 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-11-22 16:15:46 +0100 |
commit | 4547e894e9f924221f1ec4ff8e71fa750bab3595 (patch) | |
tree | 194ce8c3795249e539b7f1bc63a64dc21de6e9b8 /actionview | |
parent | 3936f38daec1aa1255cc49eeeb70093b9e0f99c0 (diff) | |
download | rails-4547e894e9f924221f1ec4ff8e71fa750bab3595.tar.gz rails-4547e894e9f924221f1ec4ff8e71fa750bab3595.tar.bz2 rails-4547e894e9f924221f1ec4ff8e71fa750bab3595.zip |
Bring back `===` stubbing in `time_zone_select` test.
Erroneously removed in 58910dc7.
The stubbing was a regression test to ensure `time_zone_select` wasn't implemented with
`grep`. Rename the test and add a comment to make the intent clearer.
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/test/template/form_options_helper_test.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/actionview/test/template/form_options_helper_test.rb b/actionview/test/template/form_options_helper_test.rb index 06985b5a41..6b97cec34c 100644 --- a/actionview/test/template/form_options_helper_test.rb +++ b/actionview/test/template/form_options_helper_test.rb @@ -1203,9 +1203,15 @@ class FormOptionsHelperTest < ActionView::TestCase html end - def test_time_zone_select_with_priority_zones_as_regexp_using_grep_finds_no_zones + def test_time_zone_select_with_priority_zones_is_not_implemented_with_grep @firm = Firm.new("D") + # `time_zone_select` can't be written with `grep` because Active Support + # time zones don't support implicit string coercion with `to_str`. + @fake_timezones.each do |tz| + def tz.===(zone); raise Exception; end + end + html = time_zone_select("firm", "time_zone", /A|D/) assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" + "<option value=\"\" disabled=\"disabled\">-------------</option>\n" + |