]> git.openstreetmap.org Git - rails.git/commitdiff
Test tags with &-encoded characters in trace emails
authorAnton Khorev <tony29@yandex.ru>
Thu, 1 Aug 2024 16:02:16 +0000 (19:02 +0300)
committerAnton Khorev <tony29@yandex.ru>
Thu, 1 Aug 2024 16:03:44 +0000 (19:03 +0300)
test/mailers/user_mailer_test.rb

index 25123b392f3dee63f15fd129b846674c8e584321..d0c0e27ccebdec46b5d4a081eb22c112708faeac 100644 (file)
@@ -10,12 +10,12 @@ class UserMailerTest < ActionMailer::TestCase
   def test_gpx_description_tags
     trace = create(:trace) do |t|
       create(:tracetag, :trace => t, :tag => "one")
-      create(:tracetag, :trace => t, :tag => "two")
-      create(:tracetag, :trace => t, :tag => "three")
+      create(:tracetag, :trace => t, :tag => "two&three")
+      create(:tracetag, :trace => t, :tag => "four<five")
     end
     email = UserMailer.gpx_success(trace, 100)
 
-    assert_match("<em>one</em>, <em>two</em>, <em>three</em>", email.html_part.body.to_s)
+    assert_match("<em>one</em>, <em>two&amp;three</em>, <em>four&lt;five</em>", email.html_part.body.to_s)
   end
 
   def test_gpx_success_all_traces_link