diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-08 18:40:39 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-08 18:40:39 -0700 |
commit | 2080ff2872e9604155a276a830b38844dc45c3b4 (patch) | |
tree | 9c94f21d1a686324a170e8da398b0be7d008530b /actionmailer/test | |
parent | 55c1436e67d4c9ecabb0f98529b13ad129ba2864 (diff) | |
parent | 95e06e6682b3bc7f813336142213697eac36e401 (diff) | |
download | rails-2080ff2872e9604155a276a830b38844dc45c3b4.tar.gz rails-2080ff2872e9604155a276a830b38844dc45c3b4.tar.bz2 rails-2080ff2872e9604155a276a830b38844dc45c3b4.zip |
Merge pull request #24457 from jeremy/mailer/dont-deliver-later-after-message-is-loaded
Disallow calling `#deliver_later` after local message modifications.
Diffstat (limited to 'actionmailer/test')
-rw-r--r-- | actionmailer/test/message_delivery_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionmailer/test/message_delivery_test.rb b/actionmailer/test/message_delivery_test.rb index b834cdd08c..f06d69369f 100644 --- a/actionmailer/test/message_delivery_test.rb +++ b/actionmailer/test/message_delivery_test.rb @@ -93,4 +93,12 @@ class MessageDeliveryTest < ActiveSupport::TestCase @mail.deliver_later(queue: :another_queue) end end + + test 'deliver_later after accessing the message is disallowed' do + @mail.message # Load the message, which calls the mailer method. + + assert_raise RuntimeError do + @mail.deliver_later + end + end end |