Skip to content

Commit

Permalink
Merge pull request #23776 from chi6rag/master
Browse files Browse the repository at this point in the history
Adding test to verify the last week when the year is leap
  • Loading branch information
spastorino committed Feb 22, 2016
2 parents f48d271 + 93ce0f5 commit 44888ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions activesupport/test/core_ext/date_time_ext_test.rb
Expand Up @@ -186,6 +186,10 @@ def test_last_week
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
Expand Down

0 comments on commit 44888ec

Please sign in to comment.