提交 5013fe3a 编写于 作者: A Aaron Patterson

refactoring tz to a variable rather than repeating it

上级 f8a05ad2
...@@ -133,13 +133,15 @@ def test_read_attributes_before_type_cast_on_datetime ...@@ -133,13 +133,15 @@ def test_read_attributes_before_type_cast_on_datetime
end end
def test_read_attributes_after_type_cast_on_datetime 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 = @target.new
record.written_on = "2011-03-24" record.written_on = "2011-03-24"
assert_equal "2011-03-24", record.written_on_before_type_cast assert_equal "2011-03-24", record.written_on_before_type_cast
assert_equal Time.zone.parse("2011-03-24"), record.written_on 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.written_on.time_zone
record.save record.save
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册