Replace Timecop With Rails’ Time Helpers in RSpec

01-Feb-2019 2039
Time-sensitive tests can be a pain.Thankfully, for many years the timecop gem served as a way to “freeze” time and “time travel” during tests, so that any time that elapsed during the running of your tests did not affect the results.It’s such a good idea that Rails built very similar functionality into Active Support, released in Rails 4.1.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle