mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
stop test resetting global state
This commit is contained in:
parent
4d8ee28841
commit
e2b6919223
1 changed files with 6 additions and 0 deletions
|
@ -5,10 +5,16 @@ class YamlSerializationTest < ActiveRecord::TestCase
|
||||||
fixtures :topics
|
fixtures :topics
|
||||||
|
|
||||||
def test_to_yaml_with_time_with_zone_should_not_raise_exception
|
def test_to_yaml_with_time_with_zone_should_not_raise_exception
|
||||||
|
tz = Time.zone
|
||||||
Time.zone = ActiveSupport::TimeZone["Pacific Time (US & Canada)"]
|
Time.zone = ActiveSupport::TimeZone["Pacific Time (US & Canada)"]
|
||||||
ActiveRecord::Base.time_zone_aware_attributes = true
|
ActiveRecord::Base.time_zone_aware_attributes = true
|
||||||
|
|
||||||
topic = Topic.new(:written_on => DateTime.now)
|
topic = Topic.new(:written_on => DateTime.now)
|
||||||
assert_nothing_raised { topic.to_yaml }
|
assert_nothing_raised { topic.to_yaml }
|
||||||
|
|
||||||
|
ensure
|
||||||
|
Time.zone = tz
|
||||||
|
ActiveRecord::Base.time_zone_aware_attributes = false
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_roundtrip
|
def test_roundtrip
|
||||||
|
|
Loading…
Reference in a new issue