aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/date_time_ext_test.rb
diff options
context:
space:
mode:
authorChirag Aggarwal <me@chi6rag.net>2016-02-19 16:50:51 +0530
committerChirag Aggarwal <me@chi6rag.net>2016-02-20 05:18:01 +0530
commit93ce0f56d65b3f558eba46481e742799edf7a61d (patch)
treed6ee60e29fd0f12bb57725b7a70cb078145ca653 /activesupport/test/core_ext/date_time_ext_test.rb
parent2a83a6e87851d2184093ca107b4574fd1c4a658a (diff)
downloadrails-93ce0f56d65b3f558eba46481e742799edf7a61d.tar.gz
rails-93ce0f56d65b3f558eba46481e742799edf7a61d.tar.bz2
rails-93ce0f56d65b3f558eba46481e742799edf7a61d.zip
Adding test to verify the last week when the year is leap
Fixing failing specification for verifying the last week when the year is leap
Diffstat (limited to 'activesupport/test/core_ext/date_time_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/date_time_ext_test.rb4
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