Add a test for i18n interpolation into plain and html parts

I spent some time working on an alternative translation strategy, without realising some of the plain text implications.
This commit is contained in:
Andy Allan 2020-12-02 13:02:25 +00:00
parent cc1d9592df
commit dd8e5f04e3

View file

@ -17,4 +17,13 @@ class UserMailerTest < ActionMailer::TestCase
assert_match(/one two three/, email.html_part.body.to_s) assert_match(/one two three/, email.html_part.body.to_s)
end end
def test_html_encoding
user = create(:user, :display_name => "Jack & Jill <br>")
message = create(:message, :sender => user)
email = UserMailer.message_notification(message)
assert_match("Jack & Jill <br>", email.text_part.body.to_s)
assert_match("Jack &amp; Jill &lt;br&gt;", email.html_part.body.to_s)
end
end end