From aceb415edf76c3bc74baf08b2152430078da04ad Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Thu, 11 Jan 2024 18:07:18 +0300 Subject: [PATCH] Emphasize trace tags in import emails --- app/views/user_mailer/_gpx_description.html.erb | 2 +- test/mailers/user_mailer_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/user_mailer/_gpx_description.html.erb b/app/views/user_mailer/_gpx_description.html.erb index 429982136..85b4c7cae 100644 --- a/app/views/user_mailer/_gpx_description.html.erb +++ b/app/views/user_mailer/_gpx_description.html.erb @@ -2,7 +2,7 @@ <% trace_name = link_to(trace_name, @trace_url) if @trace_url %> <% trace_description = tag.em(@trace_description) %> <% if @trace_tags.length > 0 %> - <% tags = @trace_tags.map(&:tag).join(" ") %> + <% tags = safe_join @trace_tags.map { |trace_tag| tag.em trace_tag.tag }, ", " %> <%= t ".description_with_tags_html", :trace_name => trace_name, :trace_description => trace_description, :tags => tags %> <% else %> <%= t ".description_with_no_tags_html", :trace_name => trace_name, :trace_description => trace_description %> diff --git a/test/mailers/user_mailer_test.rb b/test/mailers/user_mailer_test.rb index 6df86c15e..751adcd82 100644 --- a/test/mailers/user_mailer_test.rb +++ b/test/mailers/user_mailer_test.rb @@ -15,7 +15,7 @@ class UserMailerTest < ActionMailer::TestCase end email = UserMailer.gpx_success(trace, 100) - assert_match(/one two three/, email.html_part.body.to_s) + assert_match("one, two, three", email.html_part.body.to_s) end def test_gpx_success_all_traces_link -- 2.45.1