mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Improve handling of inlined images in incoming emails
This commit is contained in:
@ -302,14 +302,22 @@ describe Email::Receiver do
|
||||
expect(topic.posts.last.raw).to eq("This is a reply :)\n\n<details class='elided'>\n<summary title='Show trimmed content'>···</summary>\n---Original Message---\nThis part should not be included\n</details>")
|
||||
end
|
||||
|
||||
it "supports attached images" do
|
||||
it "supports attached images in TEXT part" do
|
||||
SiteSetting.queue_jobs = true
|
||||
|
||||
expect { process(:no_body_with_image) }.to change { topic.posts.count }
|
||||
expect(topic.posts.last.raw).to match(/<img/)
|
||||
|
||||
expect { process(:inline_image) }.to change { topic.posts.count }
|
||||
expect(topic.posts.last.raw).to match(/Before\s+<img.+\s+After/m)
|
||||
expect(topic.posts.last.raw).to match(/Before\s+<img.+>\s+After/)
|
||||
end
|
||||
|
||||
it "supports attached images in HTML part" do
|
||||
SiteSetting.queue_jobs = true
|
||||
SiteSetting.incoming_email_prefer_html = true
|
||||
|
||||
expect { process(:inline_image) }.to change { topic.posts.count }
|
||||
expect(topic.posts.last.raw).to match(/\*\*Before\*\*\s+<img.+>\s+\*After\*/)
|
||||
end
|
||||
|
||||
it "supports attachments" do
|
||||
|
Reference in New Issue
Block a user