aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-02-19 23:26:48 -0800
committerAndrew White <andyw@pixeltrix.co.uk>2013-02-19 23:26:48 -0800
commitc3f1b1d3cdb837a24d66b80deda39cfe23856724 (patch)
treed67ba9390795752a4c2afc5ff14bc009d45ff25a /actionpack/test
parent862e75160b0856c3f9165601b3c11b881e0844b9 (diff)
parent5c73f0d398d2a7ed955040e580374e92d6536283 (diff)
downloadrails-c3f1b1d3cdb837a24d66b80deda39cfe23856724.tar.gz
rails-c3f1b1d3cdb837a24d66b80deda39cfe23856724.tar.bz2
rails-c3f1b1d3cdb837a24d66b80deda39cfe23856724.zip
Merge pull request #9330 from bdmac/time_zone_select_dup
Fix time_zone_options_for_select to not mutate TimeZones array
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/form_options_helper_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb
index c5efed3195..757b05dbc1 100644
--- a/actionpack/test/template/form_options_helper_test.rb
+++ b/actionpack/test/template/form_options_helper_test.rb
@@ -416,6 +416,13 @@ class FormOptionsHelperTest < ActionView::TestCase
"<option value=\"D\">D</option>",
opts
end
+
+ def test_time_zone_options_with_priority_zones_does_not_mutate_time_zones
+ original_zones = ActiveSupport::TimeZone.all.dup
+ zones = [ ActiveSupport::TimeZone.new( "B" ), ActiveSupport::TimeZone.new( "E" ) ]
+ opts = time_zone_options_for_select( nil, zones )
+ assert_equal original_zones, ActiveSupport::TimeZone.all
+ end
def test_time_zone_options_returns_html_safe_string
assert time_zone_options_for_select.html_safe?