FIX: wasn't unfreezing time in email processor spec

This commit is contained in:
Régis Hanol 2017-07-24 11:01:53 +02:00
parent d792e81372
commit 640ced004d
1 changed files with 7 additions and 6 deletions

View File

@ -44,13 +44,14 @@ describe Email::Processor do
Email::Processor.process!(mail2) Email::Processor.process!(mail2)
}.to change { EmailLog.count }.by(0) }.to change { EmailLog.count }.by(0)
Timecop.freeze(Date.today + 1) Timecop.freeze(Date.today + 1) do
key = "rejection_email:#{[from]}:email_reject_empty:#{Date.today}" key = "rejection_email:#{[from]}:email_reject_empty:#{Date.today}"
$redis.expire(key, 0) $redis.expire(key, 0)
expect { expect {
Email::Processor.process!(mail3) Email::Processor.process!(mail3)
}.to change { EmailLog.count }.by(1) }.to change { EmailLog.count }.by(1)
end
end end
end end