when 'Project'
added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container)
added_to = "#{l(:label_project)}: #{container}"
- recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}
+ 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 = "#{l(:label_version)}: #{container.name}"
- recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}
+ recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
when 'Document'
added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id)
added_to = "#{l(:label_document)}: #{container.title}"
end
end
+ def test_version_file_added
+ attachements = [ Attachment.find_by_container_type('Version') ]
+ assert Mailer.deliver_attachments_added(attachements)
+ assert_not_nil last_email.bcc
+ assert last_email.bcc.any?
+ end
+
+ def test_project_file_added
+ attachements = [ Attachment.find_by_container_type('Project') ]
+ assert Mailer.deliver_attachments_added(attachements)
+ assert_not_nil last_email.bcc
+ assert last_email.bcc.any?
+ end
+
def test_news_added
news = News.find(:first)
valid_languages.each do |lang|