DEV: Remove remaining hardcoded ids (#18735)

This commit is contained in:
Jarek Radosz
2022-10-25 09:29:09 +02:00
committed by GitHub
parent d85c89ba6d
commit df56ab172a
15 changed files with 60 additions and 56 deletions

View File

@ -172,14 +172,13 @@ RSpec.describe Email::Processor do
end
describe 'when replying to a post that is too old' do
let(:mail) { file_from_fixtures("old_destination.eml", "emails").read }
fab!(:user) { Fabricate(:user, email: "discourse@bar.com") }
fab!(:topic) { Fabricate(:topic) }
fab!(:post) { Fabricate(:post, topic: topic, created_at: 3.days.ago) }
let(:mail) { file_from_fixtures("old_destination.eml", "emails").read.gsub("424242", topic.id.to_s).gsub("123456", post.id.to_s) }
it 'rejects the email with the right response' do
SiteSetting.disallow_reply_by_email_after_days = 2
topic = Fabricate(:topic, id: 424242)
post = Fabricate(:post, topic: topic, id: 123456, created_at: 3.days.ago)
processor = Email::Processor.new(mail)
processor.process!