diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2018-09-19 15:52:16 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2018-09-19 15:52:16 -0700 |
commit | da697e84445f8f750b8a7d0fa916f429eda8aae4 (patch) | |
tree | 510ad1391fedcdc7a3433ef4af128007fa7fbfa0 /test/unit/mailbox/routing_test.rb | |
parent | ee6d9545dd69a96ae30fdacf264db83fbaa1e4dd (diff) | |
download | rails-da697e84445f8f750b8a7d0fa916f429eda8aae4.tar.gz rails-da697e84445f8f750b8a7d0fa916f429eda8aae4.tar.bz2 rails-da697e84445f8f750b8a7d0fa916f429eda8aae4.zip |
Attach a concrete router to the root mailbox and use it
Don't think this is how it's going to stay. Doesn't feel like the right place for it.
Diffstat (limited to 'test/unit/mailbox/routing_test.rb')
-rw-r--r-- | test/unit/mailbox/routing_test.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/mailbox/routing_test.rb b/test/unit/mailbox/routing_test.rb new file mode 100644 index 0000000000..bdb670e956 --- /dev/null +++ b/test/unit/mailbox/routing_test.rb @@ -0,0 +1,23 @@ +require_relative '../../test_helper' + +class ApplicationMailbox < ActionMailroom::Mailbox + routing "replies@example.com" => :replies +end + +class RepliesMailbox < ActionMailroom::Mailbox + def process + $processed = mail.subject + end +end + +class ActionMailroom::Mailbox::RoutingTest < ActiveSupport::TestCase + setup do + $processed = false + @inbound_email = create_inbound_email("welcome.eml") + end + + test "string routing" do + ApplicationMailbox.route @inbound_email + assert_equal "Discussion: Let's debate these attachments", $processed + end +end |