diff options
author | Aditya Sanghi <asanghi@me.com> | 2010-11-29 20:45:43 +0530 |
---|---|---|
committer | Aditya Sanghi <asanghi@me.com> | 2011-05-06 15:42:05 +0530 |
commit | ae7d0d816db3f9a94008d36ab9efbe7583700981 (patch) | |
tree | e19055231ebe51175c37fb531027a4f3d5262a5c /actionpack/test/template | |
parent | 4c755f977c0f3acaa2c331dc9ab03c1ee1c28966 (diff) | |
download | rails-ae7d0d816db3f9a94008d36ab9efbe7583700981.tar.gz rails-ae7d0d816db3f9a94008d36ab9efbe7583700981.tar.bz2 rails-ae7d0d816db3f9a94008d36ab9efbe7583700981.zip |
Take leap years into account more seriously when calculating year distance [#6074 state:resolved]
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/date_helper_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb index 12d2410f49..3dd400026c 100644 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -121,6 +121,10 @@ class DateHelperTest < ActionView::TestCase start_date = Date.new 1975, 1, 31 end_date = Date.new 1977, 1, 31 assert_equal("about 2 years", distance_of_time_in_words(start_date, end_date)) + + start_date = Date.new 1982, 12, 3 + end_date = Date.new 2010, 11, 30 + assert_equal("almost 28 years", distance_of_time_in_words(start_date, end_date)) end def test_distance_in_words_with_integers |