Show archive.org snapshot
is a great gem to set the current time in tests. However, it is easy to introduce flakyness to your test suite when you forget to reset the time after the test.
This might be the case if:
Often you only notice these kinds of errors in rare cases when tests are executed in a particular order.
A way to avoid this is by using block notation (
Timecop.travel(...) do) as this will automatically reset the time after the block.
My advice is to generally reset manipulated time after each test, so a developer can never forget to clean up.
Reset after each spec by putting this to your
config.after(:each) do Timecop.return end
Put this to something like
After do Timecop.return end