mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Add test for TimeWithZone#to_i with wrapped DateTime
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user