mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add test for TimeWithZone#to_i with wrapped DateTime
This commit is contained in:
parent
2ae8300489
commit
a4b19277b2
1 changed files with 6 additions and 0 deletions
|
@ -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 a new issue