diff options
author | James Dabbs <jamesdabbs@gmail.com> | 2019-05-04 10:53:08 -0700 |
---|---|---|
committer | James Dabbs <jamesdabbs@gmail.com> | 2019-05-04 10:53:08 -0700 |
commit | 9f96d094a39100df53ea68b8bd6fa7fcafd96eac (patch) | |
tree | 237fec97bcb99065be3d464f25f2fa69bf34b6d0 /actionmailbox/test/unit/mailbox | |
parent | ac1ba44f8d46ebbbe6889629d263e5690631f6a1 (diff) | |
download | rails-9f96d094a39100df53ea68b8bd6fa7fcafd96eac.tar.gz rails-9f96d094a39100df53ea68b8bd6fa7fcafd96eac.tar.bz2 rails-9f96d094a39100df53ea68b8bd6fa7fcafd96eac.zip |
Expose `mailbox_for` method
Currently, the only exposed entry point into the ApplicationMailbox's configured
routing system is to call `route`, which performs a lot of work to fully
`process` inbound email. It'd be nice to have a way (e.g. in test) of checking
which mailbox an email would route to without necessarily processing it yet.
Diffstat (limited to 'actionmailbox/test/unit/mailbox')
-rw-r--r-- | actionmailbox/test/unit/mailbox/routing_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionmailbox/test/unit/mailbox/routing_test.rb b/actionmailbox/test/unit/mailbox/routing_test.rb index d4ba702ac5..1ae56eb707 100644 --- a/actionmailbox/test/unit/mailbox/routing_test.rb +++ b/actionmailbox/test/unit/mailbox/routing_test.rb @@ -28,4 +28,9 @@ class ActionMailbox::Base::RoutingTest < ActiveSupport::TestCase assert_equal "Discussion: Let's debate these attachments", $processed end end + + test "mailbox_for" do + mail = create_inbound_email_from_fixture "welcome.eml", status: :pending + assert_equal RepliesMailbox, ApplicationMailbox.mailbox_for(mail) + end end |