From 4733182e566c87f5f351340f759ac84a265eb151 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Wed, 17 Jan 2007 06:28:57 +0000 Subject: Fix #distance_of_time_in_words to report accurately against the Duration class. #7114 [eventualbuddha] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5973 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/date_helper_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb index bd3ad09db8..ae0494628b 100755 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -18,7 +18,7 @@ class DateHelperTest < Test::Unit::TestCase end def test_distance_in_words - from = Time.mktime(2004, 3, 6, 21, 45, 0) + from = Time.mktime(2004, 6, 6, 21, 45, 0) # 0..1 with include_seconds assert_equal "less than 5 seconds", distance_of_time_in_words(from, from + 0.seconds, true) @@ -64,16 +64,16 @@ class DateHelperTest < Test::Unit::TestCase assert_equal "about 1 month", distance_of_time_in_words(from, from + 29.days + 23.hours + 59.minutes + 30.seconds) assert_equal "about 1 month", distance_of_time_in_words(from, from + 59.days + 23.hours + 59.minutes + 29.seconds) - # 86400..525959 + # 86400..525599 assert_equal "2 months", distance_of_time_in_words(from, from + 59.days + 23.hours + 59.minutes + 30.seconds) assert_equal "12 months", distance_of_time_in_words(from, from + 1.years - 31.seconds) - # 525960..1051919 + # 525600..1051199 assert_equal "about 1 year", distance_of_time_in_words(from, from + 1.years - 30.seconds) assert_equal "about 1 year", distance_of_time_in_words(from, from + 2.years - 31.seconds) - # > 1051920 - assert_equal "over 2 years", distance_of_time_in_words(from, from + 2.years - 30.seconds) + # > 1051199 + assert_equal "over 2 years", distance_of_time_in_words(from, from + 2.years + 30.seconds) assert_equal "over 10 years", distance_of_time_in_words(from, from + 10.years) # test to < from -- cgit v1.2.3