]> source.dussan.org Git - redmine.git/commitdiff
Fixed links in new file notification broken by r4051 (#6590).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 27 Mar 2011 16:38:08 +0000 (16:38 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 27 Mar 2011 16:38:08 +0000 (16:38 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5230 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/mailer.rb
test/unit/mailer_test.rb

index 7efa7c9981000ad2d43ddf1396db649afe3761f4..2c6b5026d2ddb9c453364875038d233fa1f56c50 100644 (file)
@@ -114,11 +114,11 @@ class Mailer < ActionMailer::Base
     added_to_url = ''
     case container.class.name
     when 'Project'
-      added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container)
+      added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container)
       added_to = "#{l(:label_project)}: #{container}"
       recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect  {|u| u.mail}
     when 'Version'
-      added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container.project_id)
+      added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project)
       added_to = "#{l(:label_version)}: #{container.name}"
       recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect  {|u| u.mail}
     when 'Document'
index 36ed4fe94198950b4754c98870445ec64bf42bd3..ced0447bc306f6e25f8f45adbe07adefcbf1ec25 100644 (file)
@@ -26,6 +26,7 @@ class MailerTest < ActiveSupport::TestCase
     ActionMailer::Base.deliveries.clear
     Setting.host_name = 'mydomain.foo'
     Setting.protocol = 'http'
+    Setting.plain_text_mail = '0'
   end
   
   def test_generated_links_in_emails
@@ -278,6 +279,9 @@ class MailerTest < ActiveSupport::TestCase
     assert Mailer.deliver_attachments_added(attachements)
     assert_not_nil last_email.bcc
     assert last_email.bcc.any?
+    assert_select_email do
+      assert_select "a[href=?]", "http://mydomain.foo/projects/ecookbook/files"
+    end
   end
   
   def test_project_file_added
@@ -285,6 +289,9 @@ class MailerTest < ActiveSupport::TestCase
     assert Mailer.deliver_attachments_added(attachements)
     assert_not_nil last_email.bcc
     assert last_email.bcc.any?
+    assert_select_email do
+      assert_select "a[href=?]", "http://mydomain.foo/projects/ecookbook/files"
+    end
   end
   
   def test_news_added