##// END OF EJS Templates
Fixed links in new file notification broken by r4051 (#6590)....
Jean-Philippe Lang -
r5110:08f44b67f535
parent child
Show More
@@ -114,11 +114,11 class Mailer < ActionMailer::Base
114 added_to_url = ''
114 added_to_url = ''
115 case container.class.name
115 case container.class.name
116 when 'Project'
116 when 'Project'
117 added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container)
117 added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container)
118 added_to = "#{l(:label_project)}: #{container}"
118 added_to = "#{l(:label_project)}: #{container}"
119 recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
119 recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
120 when 'Version'
120 when 'Version'
121 added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container.project_id)
121 added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project)
122 added_to = "#{l(:label_version)}: #{container.name}"
122 added_to = "#{l(:label_version)}: #{container.name}"
123 recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
123 recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
124 when 'Document'
124 when 'Document'
@@ -26,6 +26,7 class MailerTest < ActiveSupport::TestCase
26 ActionMailer::Base.deliveries.clear
26 ActionMailer::Base.deliveries.clear
27 Setting.host_name = 'mydomain.foo'
27 Setting.host_name = 'mydomain.foo'
28 Setting.protocol = 'http'
28 Setting.protocol = 'http'
29 Setting.plain_text_mail = '0'
29 end
30 end
30
31
31 def test_generated_links_in_emails
32 def test_generated_links_in_emails
@@ -278,6 +279,9 class MailerTest < ActiveSupport::TestCase
278 assert Mailer.deliver_attachments_added(attachements)
279 assert Mailer.deliver_attachments_added(attachements)
279 assert_not_nil last_email.bcc
280 assert_not_nil last_email.bcc
280 assert last_email.bcc.any?
281 assert last_email.bcc.any?
282 assert_select_email do
283 assert_select "a[href=?]", "http://mydomain.foo/projects/ecookbook/files"
284 end
281 end
285 end
282
286
283 def test_project_file_added
287 def test_project_file_added
@@ -285,6 +289,9 class MailerTest < ActiveSupport::TestCase
285 assert Mailer.deliver_attachments_added(attachements)
289 assert Mailer.deliver_attachments_added(attachements)
286 assert_not_nil last_email.bcc
290 assert_not_nil last_email.bcc
287 assert last_email.bcc.any?
291 assert last_email.bcc.any?
292 assert_select_email do
293 assert_select "a[href=?]", "http://mydomain.foo/projects/ecookbook/files"
294 end
288 end
295 end
289
296
290 def test_news_added
297 def test_news_added
General Comments 0
You need to be logged in to leave comments. Login now