aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2009-12-15 08:28:24 -0600
committerGeoff Buesing <gbuesing@gmail.com>2009-12-15 08:28:24 -0600
commita4b19277b2a4085da3bb0f1e05584496103eeb2a (patch)
treee7cc0d132902058d7cd7c656f1a689610085b1f2
parent2ae8300489aaaaaa65f50f3557090b265a2dcc6a (diff)
downloadrails-a4b19277b2a4085da3bb0f1e05584496103eeb2a.tar.gz
rails-a4b19277b2a4085da3bb0f1e05584496103eeb2a.tar.bz2
rails-a4b19277b2a4085da3bb0f1e05584496103eeb2a.zip
Add test for TimeWithZone#to_i with wrapped DateTime
-rw-r--r--activesupport/test/core_ext/time_with_zone_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb
index bb60968a4f..3a12100e86 100644
--- a/activesupport/test/core_ext/time_with_zone_test.rb
+++ b/activesupport/test/core_ext/time_with_zone_test.rb
@@ -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