aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/integration_test.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-10-25 06:10:11 -0700
committerYves Senn <yves.senn@gmail.com>2013-10-25 06:10:11 -0700
commit2dc579baf4045fc6bcc38a2fe00d5fd19431201f (patch)
tree677910129b09dbf604993c5d4ec2834fd73d0d98 /activerecord/test/cases/integration_test.rb
parent3c3ffac0117a9a3ce4de1f84a7a3eb7a35d016a8 (diff)
parentabe91cb3bf1b408a23958e14a68077e56a5a3b84 (diff)
downloadrails-2dc579baf4045fc6bcc38a2fe00d5fd19431201f.tar.gz
rails-2dc579baf4045fc6bcc38a2fe00d5fd19431201f.tar.bz2
rails-2dc579baf4045fc6bcc38a2fe00d5fd19431201f.zip
Merge pull request #12633 from senny/no_more_time_zone_leaks
prevent global timezone state from leaking out of test cases.
Diffstat (limited to 'activerecord/test/cases/integration_test.rb')
-rw-r--r--activerecord/test/cases/integration_test.rb13
1 files changed, 4 insertions, 9 deletions
diff --git a/activerecord/test/cases/integration_test.rb b/activerecord/test/cases/integration_test.rb
index f5daca2fa8..406aacb056 100644
--- a/activerecord/test/cases/integration_test.rb
+++ b/activerecord/test/cases/integration_test.rb
@@ -23,17 +23,12 @@ class IntegrationTest < ActiveRecord::TestCase
end
def test_cache_key_for_existing_record_is_not_timezone_dependent
- ActiveRecord::Base.time_zone_aware_attributes = true
-
- Time.zone = 'UTC'
utc_key = Developer.first.cache_key
- Time.zone = 'EST'
- est_key = Developer.first.cache_key
-
- assert_equal utc_key, est_key
- ensure
- Time.zone = 'UTC'
+ with_timezone_config zone: "EST" do
+ est_key = Developer.first.cache_key
+ assert_equal utc_key, est_key
+ end
end
def test_cache_key_format_for_existing_record_with_updated_at