]> git.openstreetmap.org Git - rails.git/blobdiff - test/mailers/user_mailer_test.rb
Merge remote-tracking branch 'upstream/pull/4297'
[rails.git] / test / mailers / user_mailer_test.rb
index 2a4b5a417a92a834c64d65be825d6fa6ed40b232..537bb9d0ddf60ec4220007d56d3c6986f524be7b 100644 (file)
@@ -17,4 +17,13 @@ class UserMailerTest < ActionMailer::TestCase
 
     assert_match(/one two three/, email.html_part.body.to_s)
   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