mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
DEV: Remove remaining hardcoded ids (#18735)
This commit is contained in:
@ -83,18 +83,19 @@ RSpec.describe Email::Receiver do
|
||||
it "raises an OldDestinationError when notification is too old" do
|
||||
SiteSetting.disallow_reply_by_email_after_days = 2
|
||||
|
||||
topic = Fabricate(:topic, id: 424242)
|
||||
post = Fabricate(:post, topic: topic, id: 123456)
|
||||
topic = Fabricate(:topic)
|
||||
post = Fabricate(:post, topic: topic)
|
||||
user = Fabricate(:user, email: "discourse@bar.com")
|
||||
|
||||
expect { process(:old_destination) }.to raise_error(
|
||||
mail = email(:old_destination).gsub("424242", topic.id.to_s)
|
||||
expect { Email::Receiver.new(mail).process! }.to raise_error(
|
||||
Email::Receiver::BadDestinationAddress
|
||||
)
|
||||
|
||||
IncomingEmail.destroy_all
|
||||
post.update!(created_at: 3.days.ago)
|
||||
|
||||
expect { process(:old_destination) }.to raise_error(
|
||||
expect { Email::Receiver.new(mail).process! }.to raise_error(
|
||||
Email::Receiver::OldDestinationError
|
||||
)
|
||||
expect(IncomingEmail.last.error).to eq("Email::Receiver::OldDestinationError")
|
||||
@ -102,7 +103,7 @@ RSpec.describe Email::Receiver do
|
||||
SiteSetting.disallow_reply_by_email_after_days = 0
|
||||
IncomingEmail.destroy_all
|
||||
|
||||
expect { process(:old_destination) }.to raise_error(
|
||||
expect { Email::Receiver.new(mail).process! }.to raise_error(
|
||||
Email::Receiver::BadDestinationAddress
|
||||
)
|
||||
end
|
||||
@ -434,7 +435,7 @@ RSpec.describe Email::Receiver do
|
||||
expect(topic.posts.last.raw).to eq("This will not include the previous discussion that is present in this email.")
|
||||
end
|
||||
|
||||
it "removes the trnaslated 'Previous Replies' marker" do
|
||||
it "removes the translated 'Previous Replies' marker" do
|
||||
expect { process(:previous_replies_de) }.to change { topic.posts.count }
|
||||
expect(topic.posts.last.raw).to eq("This will not include the previous discussion that is present in this email.")
|
||||
end
|
||||
|
Reference in New Issue
Block a user