aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorSergey Nartimov <just.lest@gmail.com>2012-05-13 14:21:00 +0300
committerSergey Nartimov <just.lest@gmail.com>2012-05-13 14:21:00 +0300
commitc17d200e3f1b86219c0e12809e93e8943dfa325a (patch)
tree71bcd84a8f8090c118772de75a245b9972f35ab0 /actionmailer/test
parent7d67880a2d680a5edf85157569f7da20c52f15c4 (diff)
downloadrails-c17d200e3f1b86219c0e12809e93e8943dfa325a.tar.gz
rails-c17d200e3f1b86219c0e12809e93e8943dfa325a.tar.bz2
rails-c17d200e3f1b86219c0e12809e93e8943dfa325a.zip
mailer can be anonymous
closes #5970
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/base_test.rb13
-rw-r--r--actionmailer/test/fixtures/anonymous/welcome.erb1
2 files changed, 14 insertions, 0 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb
index aed3ee1874..1d747ed18a 100644
--- a/actionmailer/test/base_test.rb
+++ b/actionmailer/test/base_test.rb
@@ -610,6 +610,19 @@ class BaseTest < ActiveSupport::TestCase
assert_equal Set.new(["notify"]), FooMailer.action_methods
end
+ test "mailer can be anonymous" do
+ mailer = Class.new(ActionMailer::Base) do
+ def welcome
+ mail
+ end
+ end
+
+ assert_equal "anonymous", mailer.mailer_name
+
+ assert_equal "Welcome", mailer.welcome.subject
+ assert_equal "Anonymous mailer body", mailer.welcome.body.encoded.strip
+ end
+
protected
# Execute the block setting the given values and restoring old values after
diff --git a/actionmailer/test/fixtures/anonymous/welcome.erb b/actionmailer/test/fixtures/anonymous/welcome.erb
new file mode 100644
index 0000000000..8361da62c4
--- /dev/null
+++ b/actionmailer/test/fixtures/anonymous/welcome.erb
@@ -0,0 +1 @@
+Anonymous mailer body