1
0
Fork 0
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:
Jon Leighton 2011-12-23 23:22:24 +00:00
parent 4d8ee28841
commit e2b6919223

View file

@ -5,10 +5,16 @@ class YamlSerializationTest < ActiveRecord::TestCase
fixtures :topics
def test_to_yaml_with_time_with_zone_should_not_raise_exception
tz = Time.zone
Time.zone = ActiveSupport::TimeZone["Pacific Time (US & Canada)"]
ActiveRecord::Base.time_zone_aware_attributes = true
topic = Topic.new(:written_on => DateTime.now)
assert_nothing_raised { topic.to_yaml }
ensure
Time.zone = tz
ActiveRecord::Base.time_zone_aware_attributes = false
end
def test_roundtrip