FIX: allow user quotes in HTML digest emails

This commit is contained in:
Régis Hanol
2018-05-13 18:23:17 +02:00
parent 37232fcb58
commit 9d9332d8c9
2 changed files with 21 additions and 1 deletions

View File

@ -34,5 +34,23 @@ describe UserNotificationsHelper do
SiteSetting.digest_min_excerpt_length = 50
expect(helper.email_excerpt(arg)).to eq([with_link, paragraphs[0]].join)
end
it "uses user quotes but not post quotes" do
cooked = <<~HTML
<p>BEFORE</p>
<blockquote>
<p>This is a user quote</p>
</blockquote>
<aside class="quote" data-post="3" data-topic="87369">
<div class="title">A Title</div>
<blockquote>
<p>This is a post quote</p>
</blockquote>
</aside>
<p>AFTER</p>
HTML
expect(helper.email_excerpt(cooked)).to eq "<p>BEFORE</p><blockquote>\n <p>This is a user quote</p>\n</blockquote><p>AFTER</p>"
end
end
end