]> source.dussan.org Git - redmine.git/commitdiff
Fixed: Link is escaped in wiki added/updated notification email (#11262).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 26 Jun 2012 17:03:08 +0000 (17:03 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 26 Jun 2012 17:03:08 +0000 (17:03 +0000)
Patch by Ćukasz Jachymczyk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9896 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/mailer/wiki_content_added.html.erb
app/views/mailer/wiki_content_updated.html.erb
test/unit/mailer_test.rb

index 160f5730f1539bfbcb050faeac750eda01e94dbd..8c83f62c8557cde5863ccf4658e23dbfa24fe355 100644 (file)
@@ -1,3 +1,3 @@
 <p><%= l(:mail_body_wiki_content_added, :id => link_to(h(@wiki_content.page.pretty_title), @wiki_content_url),
-                                        :author => h(@wiki_content.author)) %><br />
+                                        :author => h(@wiki_content.author)).html_safe %><br />
 <em><%=h @wiki_content.comments %></em></p>
index 8ef24d1ba0a5ccd871abb6f0876bf6fda3aa468d..f1f3857bd962cd3cd2ac93ffd957e4f83eb61e39 100644 (file)
@@ -1,5 +1,5 @@
 <p><%= l(:mail_body_wiki_content_updated, :id => link_to(h(@wiki_content.page.pretty_title), @wiki_content_url),
-                                          :author => h(@wiki_content.author)) %><br />
+                                          :author => h(@wiki_content.author)).html_safe %><br />
 <em><%=h @wiki_content.comments %></em></p>
 
 <p><%= l(:label_view_diff) %>:<br />
index 0bf62cfa730a833bd9bdff64d36d6d6901465170..3721ad497fe4ce85c03128dc1d4a58ce6ca0c46e 100644 (file)
@@ -404,6 +404,11 @@ class MailerTest < ActiveSupport::TestCase
       Setting.default_language = lang.to_s
       assert_difference 'ActionMailer::Base.deliveries.size' do
         assert Mailer.wiki_content_added(content).deliver
+        assert_select_email do
+          assert_select 'a[href=?]',
+            'http://mydomain.foo/projects/ecookbook/wiki/CookBook_documentation',
+            :text => 'CookBook documentation'
+        end
       end
     end
   end
@@ -414,6 +419,11 @@ class MailerTest < ActiveSupport::TestCase
       Setting.default_language = lang.to_s
       assert_difference 'ActionMailer::Base.deliveries.size' do
         assert Mailer.wiki_content_updated(content).deliver
+        assert_select_email do
+          assert_select 'a[href=?]',
+            'http://mydomain.foo/projects/ecookbook/wiki/CookBook_documentation',
+            :text => 'CookBook documentation'
+        end
       end
     end
   end