]> source.dussan.org Git - redmine.git/commitdiff
Merged r3532 from trunk.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 11 Apr 2010 14:30:50 +0000 (14:30 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 11 Apr 2010 14:30:50 +0000 (14:30 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.9-stable@3646 e93f8b46-1217-0410-a6f0-8f06a7374b81

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

index e987c8a87ae1775c7232a9d8f6ab21591eac9ea0..2c7cc8d457707d34b1dd8338cbcb25e70fb1690c 100644 (file)
@@ -114,11 +114,11 @@ class Mailer < ActionMailer::Base
     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}"
index 3ce33e6fb00b887d602f809a6e6687effd31092d..7ca063c8df5b7e33e83b240beb527cfd146c813d 100644 (file)
@@ -237,6 +237,20 @@ class MailerTest < ActiveSupport::TestCase
     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|