aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/base_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer/test/base_test.rb')
-rw-r--r--actionmailer/test/base_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb
index 144a6bfe39..4ed332d13d 100644
--- a/actionmailer/test/base_test.rb
+++ b/actionmailer/test/base_test.rb
@@ -653,6 +653,19 @@ class BaseTest < ActiveSupport::TestCase
assert_equal "Anonymous mailer body", mailer.welcome.body.encoded.strip
end
+ test "default_from can be set" do
+ class DefaultFromMailer < ActionMailer::Base
+ default :to => 'system@test.lindsaar.net'
+ self.default_options = {from: "robert.pankowecki@gmail.com"}
+
+ def welcome
+ mail(subject: "subject", body: "hello world")
+ end
+ end
+
+ assert_equal ["robert.pankowecki@gmail.com"], DefaultFromMailer.welcome.from
+ end
+
protected
# Execute the block setting the given values and restoring old values after