Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test for TimeWithZone#to_i with wrapped DateTime

  • Loading branch information...
commit e4ebaab1cb3b7deaf6eb7816785300f0c4018210 1 parent 754bbaa
@gbuesing gbuesing authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 activesupport/test/core_ext/time_with_zone_test.rb
View
6 activesupport/test/core_ext/time_with_zone_test.rb
@@ -283,6 +283,12 @@ def test_to_i
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
end
Please sign in to comment.
Something went wrong with that request. Please try again.