Теперь для тестирования начиная с версии 4.1 есть встроенный фукнционал Time.travel
ActiveSupport::Testing::TimeHelpers#travel
ActiveSupport::Testing::TimeHelpers#travel
Time.travel 1.day Time.travel -1.day Time.travel 1.day do User.create.created_at # => 1 day from now end Time.travel_to Time.new(2004, 11, 24, 01, 04, 44) Time.travel_to Date.new(2004, 11, 24) Time.travel_to Time.new(2004, 11, 24, 01, 04, 44) do User.create.created_at # => 2004-11-24 01:04:44 -0500 end