From 8d7668caa4f1fdb1b3e34d25296083c2741ffc95 Mon Sep 17 00:00:00 2001 From: Christian Lautier <15379878+maatinito@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:15:40 -1000 Subject: [PATCH] fix PurgeOldEmailEventJobSpec (timezone bug) --- spec/jobs/cron/purge_old_email_event_job_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/jobs/cron/purge_old_email_event_job_spec.rb b/spec/jobs/cron/purge_old_email_event_job_spec.rb index 79061de3bd5..4f57fa50e01 100644 --- a/spec/jobs/cron/purge_old_email_event_job_spec.rb +++ b/spec/jobs/cron/purge_old_email_event_job_spec.rb @@ -1,11 +1,11 @@ RSpec.describe Cron::PurgeOldEmailEventJob, type: :job do describe 'perform' do subject { Cron::PurgeOldEmailEventJob.perform_now } - let(:older_than_retention_duration) { create(:email_event, :dolist, created_at: Time.zone.now.utc - (EmailEvent::RETENTION_DURATION + 1.day)) } - let(:more_recent_than_retention_duraiton) { create(:email_event, :dolist, created_at: Time.zone.now.utc - (EmailEvent::RETENTION_DURATION - 1.day)) } + let(:older_than_retention_duration) { create(:email_event, :dolist, created_at: Time.zone.now - (EmailEvent::RETENTION_DURATION + 1.day)) } + let(:more_recent_than_retention_duration) { create(:email_event, :dolist, created_at: Time.zone.now - (EmailEvent::RETENTION_DURATION - 1.day)) } before do older_than_retention_duration - more_recent_than_retention_duraiton + more_recent_than_retention_duration end it { expect { subject }.to change { EmailEvent.count }.by(-1) }