From 93ce0f56d65b3f558eba46481e742799edf7a61d Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 19 Feb 2016 16:50:51 +0530 Subject: 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 --- activesupport/test/core_ext/date_time_ext_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport/test/core_ext/date_time_ext_test.rb') 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 -- cgit v1.2.3