1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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
This commit is contained in:
Chirag Aggarwal 2016-02-19 16:50:51 +05:30
parent 2a83a6e878
commit 93ce0f56d6

View file

@ -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