rails/actionpack/test
Andrey Novikov cb9d0e4864
Fix inconsistent results when parsing large durations and constructing durations from code
ActiveSupport::Duration.parse('P3Y') == 3.years # It should be true

Duration parsing made independent from any moment of time:
Fixed length in seconds is assigned to each duration part during parsing.

Changed duration of months and years in seconds to more accurate and logical:

 1. The value of 365.2425 days in Gregorian year is more accurate
    as it accounts for every 400th non-leap year.

 2. Month's length is bound to year's duration, which makes
    sensible comparisons like `12.months == 1.year` to be `true`
    and nonsensical ones like `30.days == 1.month` to be `false`.

Calculations on times and dates with durations shouldn't be affected as
duration's numeric value isn't used in calculations, only parts are used.

Methods on `Numeric` like `2.days` now use these predefined durations
to avoid duplicating of duration constants through the codebase and
eliminate creation of intermediate durations.
2017-01-09 23:04:48 +03:00
..
abstract Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
assertions Improve assert_response helper 2016-09-14 11:30:09 -04:00
controller self. is not needed when calling its own instance method 2017-01-05 19:58:52 +09:00
dispatch Fix inconsistent results when parsing large durations and constructing durations from code 2017-01-09 23:04:48 +03:00
fixtures Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
journey Optimize Journey::Route#score 2016-12-28 17:19:15 -08:00
lib/controller Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
routing applies new string literal convention in actionpack/test 2016-08-06 18:54:50 +02:00
tmp
abstract_unit.rb Fix style guide violations 2017-01-05 00:40:24 -05:00