Created
January 3, 2017 14:24
-
-
Save antico5/4c570cabfe04c76fb037811fbedb3ffa to your computer and use it in GitHub Desktop.
time travel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
include ActiveSupport::Testing::TimeHelpers | |
describe TimeTravel do | |
it 'allows person to answer after 1 day' do | |
expect(person_can_answer).to be_falsey | |
# About to go to the future | |
travel(1.day) do | |
# While in the future | |
expect(person_can_answer).to be_truthy | |
end | |
# Back to reality | |
expect(person_can_answer).to be_falsey | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment