Permalink
Browse files

refactoring tz to a variable rather than repeating it

  • Loading branch information...
1 parent f28b08a commit c9708ada21d31ef0fdb3e1f84d6605a641d6b4dc @tenderlove tenderlove committed Mar 27, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 activerecord/test/cases/attribute_methods_test.rb
@@ -132,13 +132,15 @@ def test_read_attributes_before_type_cast_on_datetime
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

0 comments on commit c9708ad

Please sign in to comment.