Add Site Setting to use HTML from incoming email when available. (#4236)

This commit is contained in:
David McClure
2016-05-26 01:13:01 -07:00
committed by Régis Hanol
parent a53b6d1d1b
commit a92fd9d701
4 changed files with 29 additions and 9 deletions

View File

@ -171,6 +171,18 @@ describe Email::Receiver do
expect(topic.posts.last.raw).to eq("This is the *text* part.")
end
it "prefers html over text when site setting is enabled" do
SiteSetting.incoming_email_prefer_html = true
expect { process(:text_and_html_reply) }.to change { topic.posts.count }
expect(topic.posts.last.raw).to eq('This is the <b>html</b> part.')
end
it "uses text when prefer_html site setting is enabled but no html is available" do
SiteSetting.incoming_email_prefer_html = true
expect { process(:text_reply) }.to change { topic.posts.count }
expect(topic.posts.last.raw).to eq("This is a text reply :)")
end
it "removes the 'on <date>, <contact> wrote' quoting line" do
expect { process(:on_date_contact_wrote) }.to change { topic.posts.count }
expect(topic.posts.last.raw).to eq("This is the actual reply.")