Replace Timecop With Rails’ Time Helpers in RSpec
01-Feb-2019 1998
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.
Replace Timecop With Rails’ Time Helpers in RSpec #ruby #rubydeveloper #rubyonrails #Replace #Timecop #Rails’ #Helpers #RSpec #rspec https://rubyonrails.ba/link/replace-timecop-with-rails-time-helpers-in-rspec