mirror of https://github.com/rails/rails
Add test for TimeWithZone#to_i with wrapped DateTime
This commit is contained in:
parent
2ae8300489
commit
a4b19277b2
|
@ -284,6 +284,12 @@ class TimeWithZoneTest < Test::Unit::TestCase
|
|||
assert_equal 946684800, result
|
||||
assert result.is_a?(Integer)
|
||||
end
|
||||
|
||||
def test_to_i_with_wrapped_datetime
|
||||
datetime = DateTime.civil(2000, 1, 1, 0)
|
||||
twz = ActiveSupport::TimeWithZone.new(datetime, @time_zone)
|
||||
assert_equal 946684800, twz.to_i
|
||||
end
|
||||
|
||||
def test_to_time
|
||||
assert_equal @twz, @twz.to_time
|
||||
|
|
Loading…
Reference in New Issue