aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/router_test.rb
blob: 53a3d29f40d6856d63783ecacbe29d14bd8afbf9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require_relative '../test_helper'

class RepliesMailbox < ActionMailroom::Mailbox
  def process
    $processed = true
  end
end

module ActionMailroom
  class RouterTest < ActiveSupport::TestCase
    setup do
      @router = ActionMailroom::Router.new('replies@example.com' => :replies)
      $processed = false
    end

    test "routed to mailbox" do
      @router.route create_inbound_email("welcome.eml")
      assert $processed
    end
  end
end