diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2016-02-21 21:55:52 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2016-02-21 21:55:52 -0300 |
commit | 44888ecbe9d7c42fe2347b876503a1111d02280c (patch) | |
tree | e675fcd1455ab208b94a45e70903474a624a072f /activesupport | |
parent | f48d271206fbc99ba381666308201ebb06cc307f (diff) | |
parent | 93ce0f56d65b3f558eba46481e742799edf7a61d (diff) | |
download | rails-44888ecbe9d7c42fe2347b876503a1111d02280c.tar.gz rails-44888ecbe9d7c42fe2347b876503a1111d02280c.tar.bz2 rails-44888ecbe9d7c42fe2347b876503a1111d02280c.zip |
Merge pull request #23776 from chi6rag/master
Adding test to verify the last week when the year is leap
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/core_ext/date_time_ext_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/date_time_ext_test.rb b/activesupport/test/core_ext/date_time_ext_test.rb index 6fe38c45ec..b183a20e0d 100644 --- a/activesupport/test/core_ext/date_time_ext_test.rb +++ b/activesupport/test/core_ext/date_time_ext_test.rb @@ -186,6 +186,10 @@ class DateTimeExtCalculationsTest < ActiveSupport::TestCase assert_equal DateTime.civil(2006,11,15), DateTime.civil(2006,11,23,0,0,0).last_week(:wednesday) end + def test_date_time_should_have_correct_last_week_for_leap_year + assert_equal DateTime.civil(2016, 2, 29), DateTime.civil(2016, 3, 7).last_week + end + def test_last_month_on_31st assert_equal DateTime.civil(2004, 2, 29), DateTime.civil(2004, 3, 31).last_month end |