diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-04-27 10:15:52 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-04-28 16:00:08 +0200 |
commit | 767d60156b89382326ce42f3ddca0cb860d38149 (patch) | |
tree | a733adc3ac35b76fd84fc4cccc291bdeda2c424a /railties/test/application | |
parent | d704f8f808210171964d1822d5ffd6b227b702b2 (diff) | |
download | rails-767d60156b89382326ce42f3ddca0cb860d38149.tar.gz rails-767d60156b89382326ce42f3ddca0cb860d38149.tar.bz2 rails-767d60156b89382326ce42f3ddca0cb860d38149.zip |
mailer previews for `NullMail` instances. Closes #19849.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/mailer_previews_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/railties/test/application/mailer_previews_test.rb b/railties/test/application/mailer_previews_test.rb index 1752a9f3c6..83501a7f11 100644 --- a/railties/test/application/mailer_previews_test.rb +++ b/railties/test/application/mailer_previews_test.rb @@ -327,6 +327,32 @@ module ApplicationTests assert_match "Email 'bar' not found in NotifierPreview", last_response.body end + test "mailer preview NullMail" do + mailer 'notifier', <<-RUBY + class Notifier < ActionMailer::Base + default from: "from@example.com" + + def foo + # does not call +mail+ + end + end + RUBY + + mailer_preview 'notifier', <<-RUBY + class NotifierPreview < ActionMailer::Preview + def foo + Notifier.foo + end + end + RUBY + + app('development') + + get "/rails/mailers/notifier/foo" + assert_match "You are trying to preview an email that does not have any content.", last_response.body + assert_match "notifier#foo", last_response.body + end + test "mailer preview email part not found" do mailer 'notifier', <<-RUBY class Notifier < ActionMailer::Base |