ActiveSupport::Testing::TimeHelpers

module ActiveSupport::Testing::TimeHelpers

Contains helpers that help you test passage of time.

Public Instance Methods

travel(duration, &block) Show source

Changes current time to the time in the future or in the past by a given time difference by stubbing Time.now, Date.today, and DateTime.now.

Time.current     # => Sat, 09 Nov 2013 15:34:49 EST -05:00
travel 1.day
Time.current     # => S