Rails Time Testing Old code would use the TimeCop gem, but Rails 5.2 has native time helpers - migration example.