diff options
-rw-r--r-- | activerecord/test/cases/attribute_methods_test.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index eacb18980c..34271be8b0 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -133,13 +133,15 @@ class AttributeMethodsTest < ActiveRecord::TestCase end def test_read_attributes_after_type_cast_on_datetime - in_time_zone "Pacific Time (US & Canada)" do + tz = "Pacific Time (US & Canada)" + + in_time_zone tz do record = @target.new record.written_on = "2011-03-24" assert_equal "2011-03-24", record.written_on_before_type_cast assert_equal Time.zone.parse("2011-03-24"), record.written_on - assert_equal ActiveSupport::TimeZone["Pacific Time (US & Canada)"], + assert_equal ActiveSupport::TimeZone[tz], record.written_on.time_zone record.save |