travel_to(date_or_time, &block)
Instance Public methods
Changes current time to the given time by stubbing Time.now
and Date.today to return the time or date passed into this
method.
Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00
travel_to Time.new(2004, 11, 24, 01, 04, 44)
Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00
Date.current # => Wed, 24 Nov 2004
Dates are taken as their timestamp at the beginning of the day in the
application time zone. Time.c