diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-26 17:04:54 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-26 17:04:54 -0700 |
commit | 5013fe3a1dcc0472ff11b6f94260d5dc224b5305 (patch) | |
tree | 76fb6122d53d11da1b102220275807608a4f3240 | |
parent | f8a05ad297d637596d029b013bb65128ca0aa8bd (diff) | |
download | rails-5013fe3a1dcc0472ff11b6f94260d5dc224b5305.tar.gz rails-5013fe3a1dcc0472ff11b6f94260d5dc224b5305.tar.bz2 rails-5013fe3a1dcc0472ff11b6f94260d5dc224b5305.zip |
refactoring tz to a variable rather than repeating it
-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 |