diff options
-rw-r--r-- | actionmailer/lib/action_mailer/delivery_method/file.rb | 2 | ||||
-rw-r--r-- | actionmailer/test/mail_service_test.rb | 19 |
2 files changed, 14 insertions, 7 deletions
diff --git a/actionmailer/lib/action_mailer/delivery_method/file.rb b/actionmailer/lib/action_mailer/delivery_method/file.rb index 587ae37ffa..99ef5bc76d 100644 --- a/actionmailer/lib/action_mailer/delivery_method/file.rb +++ b/actionmailer/lib/action_mailer/delivery_method/file.rb @@ -12,7 +12,7 @@ module ActionMailer def perform_delivery(mail) FileUtils.mkdir_p settings[:location] - (mail.to + mail.cc + mail.bcc).uniq.each do |to| + mail.destinations.uniq.each do |to| ::File.open(::File.join(settings[:location], to), 'a') { |f| f.write(mail) } end end diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index fb30a4dcb3..6c61bc8c00 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -561,12 +561,10 @@ class ActionMailerTest < Test::Unit::TestCase created = TestMailer.create_iso_charset @recipient end assert_not_nil created - expected.message_id = '<123@456>' - created.message_id = '<123@456>' expected.message_id = '<123@456>' created.message_id = '<123@456>' - + assert_equal expected.encoded, created.encoded assert_nothing_raised do @@ -597,14 +595,23 @@ class ActionMailerTest < Test::Unit::TestCase created = TestMailer.create_unencoded_subject @recipient end assert_not_nil created + + expected.message_id = '<123@456>' + created.message_id = '<123@456>' + assert_equal expected.encoded, created.encoded assert_nothing_raised do TestMailer.deliver_unencoded_subject @recipient end - assert_not_nil ActionMailer::Base.deliveries.first - assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded + delivered = ActionMailer::Base.deliveries.first + assert_not_nil delivered + + expected.message_id = '<123@456>' + delivered.message_id = '<123@456>' + + assert_equal expected.encoded, delivered.encoded end def test_instances_are_nil @@ -1065,7 +1072,7 @@ EOF def test_body_is_stored_as_an_ivar mail = TestMailer.create_body_ivar(@recipient) - assert_equal "body: foo\nbar: baz", mail.body.encoded + assert_equal "body: foo\nbar: baz", mail.body.decoded end def test_starttls_is_enabled_if_supported |