Closed ydah closed 2 years ago
It is worth mentioning that freeze_time
just delegates to travel_to
with a default Time.now
(https://github.com/rails/rails/blob/aa3a6c9c1b70e49bef5a2713aae96179debdff3e/activesupport/lib/active_support/testing/time_helpers.rb#L237):
def freeze_time(&block)
travel_to Time.now, &block
end
Thanks!
Since there are several ways to indicate the current time, we believe that
freeze_time
, which can be expressed as simply as possible, should be preferred.