mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:36:40 +08:00
FIX: wasn't able to parse FROM email in the embedded email
This commit is contained in:
parent
8a0cf1b90e
commit
62763f025c
4 changed files with 77 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue