diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/mailbox/state_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/mailbox/state_test.rb b/test/unit/mailbox/state_test.rb index de9da54d3f..6215e02837 100644 --- a/test/unit/mailbox/state_test.rb +++ b/test/unit/mailbox/state_test.rb @@ -14,6 +14,14 @@ class UnsuccessfulMailbox < ActionMailroom::Mailbox end end +class BouncingMailbox < ActionMailroom::Mailbox + def process + $processed = :bounced + bounced! + end +end + + class ActionMailroom::Mailbox::StateTest < ActiveSupport::TestCase setup do $processed = false @@ -32,4 +40,10 @@ class ActionMailroom::Mailbox::StateTest < ActiveSupport::TestCase assert @inbound_email.failed? assert_equal :failure, $processed end + + test "bounced inbound emails are not delivered" do + BouncingMailbox.receive @inbound_email + assert @inbound_email.bounced? + assert_equal :bounced, $processed + end end |