diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-16 05:56:49 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-16 05:56:49 +0000 |
commit | a3659d583586d45c5f48fdd103ff8c797cecfafe (patch) | |
tree | 26bcbdffe69b82de8e5969c3ea48c15a6dc4adbe /activesupport/test | |
parent | 4351419ba510be02b99215028807e8341c26428c (diff) | |
download | rails-a3659d583586d45c5f48fdd103ff8c797cecfafe.tar.gz rails-a3659d583586d45c5f48fdd103ff8c797cecfafe.tar.bz2 rails-a3659d583586d45c5f48fdd103ff8c797cecfafe.zip |
Fixed Time#at_beginning_of_week returned the next Monday instead of the previous one when called on a Sunday #1403 [jean.helou@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1431 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/time_ext_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb index 18ae3219bc..6be1a70f94 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -13,6 +13,13 @@ class TimeExtCalculationsTest < Test::Unit::TestCase def test_begining_of_week assert_equal Time.local(2005,1,31), Time.local(2005,2,4,10,10,10).beginning_of_week + assert_equal Time.local(2005,11,28), Time.local(2005,11,28,0,0,0).beginning_of_week #monday + assert_equal Time.local(2005,11,28), Time.local(2005,11,29,0,0,0).beginning_of_week #tuesday + assert_equal Time.local(2005,11,28), Time.local(2005,11,30,0,0,0).beginning_of_week #wednesday + assert_equal Time.local(2005,11,28), Time.local(2005,12,01,0,0,0).beginning_of_week #thursday + assert_equal Time.local(2005,11,28), Time.local(2005,12,02,0,0,0).beginning_of_week #friday + assert_equal Time.local(2005,11,28), Time.local(2005,12,03,0,0,0).beginning_of_week #saturday + assert_equal Time.local(2005,11,28), Time.local(2005,12,04,0,0,0).beginning_of_week #sunday end def test_beginning_of_day |