mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: Move EmailLog#reply_key into new post_reply_keys table.
This commit is contained in:
@@ -3,7 +3,6 @@ require 'rails_helper'
|
||||
describe Jobs::CleanUpEmailLogs do
|
||||
|
||||
before do
|
||||
Fabricate(:email_log, created_at: 2.years.ago, reply_key: SecureRandom.hex)
|
||||
Fabricate(:email_log, created_at: 2.years.ago)
|
||||
Fabricate(:email_log, created_at: 2.weeks.ago)
|
||||
Fabricate(:email_log, created_at: 2.days.ago)
|
||||
@@ -14,14 +13,14 @@ describe Jobs::CleanUpEmailLogs do
|
||||
|
||||
it "removes old email logs without a reply_key" do
|
||||
Jobs::CleanUpEmailLogs.new.execute({})
|
||||
expect(EmailLog.count).to eq(3)
|
||||
expect(EmailLog.count).to eq(2)
|
||||
expect(SkippedEmailLog.count).to eq(1)
|
||||
end
|
||||
|
||||
it "does not remove old email logs when delete_email_logs_after_days is 0" do
|
||||
SiteSetting.delete_email_logs_after_days = 0
|
||||
Jobs::CleanUpEmailLogs.new.execute({})
|
||||
expect(EmailLog.count).to eq(4)
|
||||
expect(EmailLog.count).to eq(3)
|
||||
expect(SkippedEmailLog.count).to eq(2)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user