Flaky Spec Fix:Set Expired Listing to 2 days ago (#10327)

This commit is contained in:
Molly Struve 2020-09-14 12:46:08 -05:00 committed by GitHub
parent 7520caf0e2
commit 7dcf2ad97e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ RSpec.describe Listings::ExpireOldListingsWorker, type: :worker do
it "expires only old listings" do
Timecop.freeze do
bumped_listing = create(:listing, bumped_at: 41.days.ago, published: true)
expired_listing = create(:listing, expires_at: 1.day.ago, published: true)
expired_listing = create(:listing, expires_at: 2.days.ago, published: true)
valid_listing = create(:listing, expires_at: 1.week.from_now, published: true)
worker.perform