@@ -114,11 +114,11 class Mailer < ActionMailer::Base | |||
|
114 | 114 | when 'Project' |
|
115 | 115 | added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container) |
|
116 | 116 | added_to = "#{l(:label_project)}: #{container}" |
|
117 | recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)} | |
|
117 | recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail} | |
|
118 | 118 | when 'Version' |
|
119 | 119 | added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container.project_id) |
|
120 | 120 | added_to = "#{l(:label_version)}: #{container.name}" |
|
121 | recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)} | |
|
121 | recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail} | |
|
122 | 122 | when 'Document' |
|
123 | 123 | added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id) |
|
124 | 124 | added_to = "#{l(:label_document)}: #{container.title}" |
@@ -273,6 +273,20 class MailerTest < ActiveSupport::TestCase | |||
|
273 | 273 | end |
|
274 | 274 | end |
|
275 | 275 | |
|
276 | def test_version_file_added | |
|
277 | attachements = [ Attachment.find_by_container_type('Version') ] | |
|
278 | assert Mailer.deliver_attachments_added(attachements) | |
|
279 | assert_not_nil last_email.bcc | |
|
280 | assert last_email.bcc.any? | |
|
281 | end | |
|
282 | ||
|
283 | def test_project_file_added | |
|
284 | attachements = [ Attachment.find_by_container_type('Project') ] | |
|
285 | assert Mailer.deliver_attachments_added(attachements) | |
|
286 | assert_not_nil last_email.bcc | |
|
287 | assert last_email.bcc.any? | |
|
288 | end | |
|
289 | ||
|
276 | 290 | def test_news_added |
|
277 | 291 | news = News.find(:first) |
|
278 | 292 | valid_languages.each do |lang| |
General Comments 0
You need to be logged in to leave comments.
Login now