aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2005-06-17 13:42:23 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2005-06-17 13:42:23 +0000
commit959707bfb62108fe9924ed4fefd6f3458972493a (patch)
treed82c5451a3921d4530910f67ed68cfc3887fb6c1 /actionpack/test
parentd808cd4582d407a7b0dae93ee94da6fbc8cd0c2b (diff)
downloadrails-959707bfb62108fe9924ed4fefd6f3458972493a.tar.gz
rails-959707bfb62108fe9924ed4fefd6f3458972493a.tar.bz2
rails-959707bfb62108fe9924ed4fefd6f3458972493a.zip
r1335@iwill: jeremy | 2005-06-17 11:41:50 -0700
Ticket 1458 - distance_of_time_in_words r1336@iwill: jeremy | 2005-06-17 11:44:50 -0700 Update changelog r1337@iwill: jeremy | 2005-06-17 11:45:44 -0700 Applied patch. r1361@iwill: jeremy | 2005-06-17 11:48:02 -0700 Merge changelog git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1449 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rwxr-xr-xactionpack/test/template/date_helper_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb
index 7ef45d2b1c..2bd3dccf8c 100755
--- a/actionpack/test/template/date_helper_test.rb
+++ b/actionpack/test/template/date_helper_test.rb
@@ -30,6 +30,15 @@ class DateHelperTest < Test::Unit::TestCase
# test to < from
assert_equal "about 4 hours", distance_of_time_in_words(Time.mktime(2004, 3, 7, 1, 20), from)
assert_equal "less than 20 seconds", distance_of_time_in_words(Time.mktime(2004, 3, 6, 21, 41, 38), from, true)
+
+ # test with integers
+ assert_equal "less than a minute", distance_of_time_in_words(50)
+ assert_equal "about 1 hour", distance_of_time_in_words(60*60)
+
+ # more cumbersome test with integers
+ assert_equal "less than a minute", distance_of_time_in_words(0, 50)
+ assert_equal "about 1 hour", distance_of_time_in_words(60*60, 0)
+
end
def test_distance_in_words_date