aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/base_test.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb
index b8d21132de..d8616ee3be 100644
--- a/actionmailer/test/base_test.rb
+++ b/actionmailer/test/base_test.rb
@@ -1,16 +1,14 @@
# encoding: utf-8
require 'abstract_unit'
-# class Notifier < ActionMailer::Base
-# delivers_from 'notifications@example.com'
class BaseTest < ActiveSupport::TestCase
DEFAULT_HEADERS = {
:to => 'mikel@test.lindsaar.net',
- :from => 'jose@test.plataformatec.com',
:subject => 'The first email on new API!'
}
class BaseMailer < ActionMailer::Base
+ delivers_from 'jose@test.plataformatec.com'
self.mailer_name = "base_mailer"
def welcome(hash = {})
@@ -72,6 +70,11 @@ class BaseTest < ActiveSupport::TestCase
assert_equal(email.subject, 'The first email on new API!')
end
+ test "mail() with from overwrites the class level default" do
+ email = BaseMailer.welcome(:from => 'someone@else.com').deliver
+ assert_equal(email.from, ['someone@else.com'])
+ end
+
test "mail() with bcc, cc, content_type, charset, mime_version, reply_to and date" do
@time = Time.now
email = BaseMailer.welcome(:bcc => 'bcc@test.lindsaar.net',