summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-09-20 14:07:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-09-20 14:07:52 +0000
commit6854827f1a1b98a60b6b1e91dd424277d72606db (patch)
treeb03840da4028db1cde91b520c3cc7939d2abf3f5 /test
parent5452fd2f5a14bf18ef3a66f7fb453912fe1c574b (diff)
downloadredmine-6854827f1a1b98a60b6b1e91dd424277d72606db.tar.gz
redmine-6854827f1a1b98a60b6b1e91dd424277d72606db.zip
Fixed: Roadmap crashes when a version has a due date > 2037.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1887 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/helpers/application_helper_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index 7ef47f592..35e26ebd4 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -367,4 +367,18 @@ EXPECTED
assert_equal Time.now.strftime('%d %m %Y %H %M'), format_time(now)
assert_equal Time.now.strftime('%H %M'), format_time(now, false)
end
+
+ def test_due_date_distance_in_words
+ to_test = { Date.today => 'Due in 0 days',
+ Date.today + 1 => 'Due in 1 day',
+ Date.today + 100 => 'Due in 100 days',
+ Date.today + 20000 => 'Due in 20000 days',
+ Date.today - 1 => '1 day late',
+ Date.today - 100 => '100 days late',
+ Date.today - 20000 => '20000 days late',
+ }
+ to_test.each do |date, expected|
+ assert_equal expected, due_date_distance_in_words(date)
+ end
+ end
end