mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: wasn't able to parse FROM email in the embedded email
This commit is contained in:
@ -383,6 +383,32 @@ describe Email::Receiver do
|
||||
expect(Post.last.raw).to match(/discourse\.rb/)
|
||||
end
|
||||
|
||||
it "handles forwarded emails" do
|
||||
SiteSetting.enable_forwarded_emails = true
|
||||
expect { process(:forwarded_email_1) }.to change(Topic, :count)
|
||||
|
||||
forwarded_post, last_post = *Post.last(2)
|
||||
|
||||
expect(forwarded_post.user.email).to eq("some@one.com")
|
||||
expect(last_post.user.email).to eq("ba@bar.com")
|
||||
|
||||
expect(forwarded_post.raw).to match(/XoXo/)
|
||||
expect(last_post.raw).to match(/can you have a look at this email below/)
|
||||
end
|
||||
|
||||
it "handles weirdly forwarded emails" do
|
||||
SiteSetting.enable_forwarded_emails = true
|
||||
expect { process(:forwarded_email_2) }.to change(Topic, :count)
|
||||
|
||||
forwarded_post, last_post = *Post.last(2)
|
||||
|
||||
expect(forwarded_post.user.email).to eq("some@one.com")
|
||||
expect(last_post.user.email).to eq("ba@bar.com")
|
||||
|
||||
expect(forwarded_post.raw).to match(/XoXo/)
|
||||
expect(last_post.raw).to match(/can you have a look at this email below/)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "new topic in a category" do
|
||||
|
Reference in New Issue
Block a user