diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-04-28 16:24:44 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-04-28 16:24:44 +0200 |
commit | 9e84c0096f2c8ec27cf354ac2817cc49cbbcb783 (patch) | |
tree | a733adc3ac35b76fd84fc4cccc291bdeda2c424a /railties/test | |
parent | 6ccf3bfa6e951fabf75352656a707f3a501b1cc2 (diff) | |
parent | 767d60156b89382326ce42f3ddca0cb860d38149 (diff) | |
download | rails-9e84c0096f2c8ec27cf354ac2817cc49cbbcb783.tar.gz rails-9e84c0096f2c8ec27cf354ac2817cc49cbbcb783.tar.bz2 rails-9e84c0096f2c8ec27cf354ac2817cc49cbbcb783.zip |
Merge pull request #19917 from senny/preview_null_mail
Previews when `mail` wasn't called (NullMail instances).
Diffstat (limited to 'railties/test')
-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 |