Reputation: 57
My model will have logic that uses Date.current like this:
if(date_three && date_three != Date.current.yesterday)
...
end
How do I change the system's current date on my specs so I can test my model with different dates?
Upvotes: 1
Views: 664
Reputation: 11198
There is a gem for just this kind of tasks - the timecop gem.
Upvotes: 5