Skip to content

Commit 44888ec

Browse files
committed
Merge pull request rails#23776 from chi6rag/master
Adding test to verify the last week when the year is leap
2 parents f48d271 + 93ce0f5 commit 44888ec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

activesupport/test/core_ext/date_time_ext_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ def test_last_week
186186
assert_equal DateTime.civil(2006,11,15), DateTime.civil(2006,11,23,0,0,0).last_week(:wednesday)
187187
end
188188

189+
def test_date_time_should_have_correct_last_week_for_leap_year
190+
assert_equal DateTime.civil(2016, 2, 29), DateTime.civil(2016, 3, 7).last_week
191+
end
192+
189193
def test_last_month_on_31st
190194
assert_equal DateTime.civil(2004, 2, 29), DateTime.civil(2004, 3, 31).last_month
191195
end

0 commit comments

Comments
 (0)