From 8a0a1034955544ee2e4c1f85317c0db84f3aa55b Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 28 Sep 2018 12:19:43 -0700 Subject: ActionMailroom -> ActionMailbox We didn't end up using the mailroom metaphor directly, so let's stick with a more conventional naming strategy. --- test/unit/mailbox/callbacks_test.rb | 4 ++-- test/unit/mailbox/routing_test.rb | 8 ++++---- test/unit/mailbox/state_test.rb | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'test/unit/mailbox') diff --git a/test/unit/mailbox/callbacks_test.rb b/test/unit/mailbox/callbacks_test.rb index 4cafeb3534..b6cfef9868 100644 --- a/test/unit/mailbox/callbacks_test.rb +++ b/test/unit/mailbox/callbacks_test.rb @@ -1,6 +1,6 @@ require_relative '../../test_helper' -class CallbackMailbox < ActionMailroom::Mailbox +class CallbackMailbox < ActionMailbox::Base before_processing { $before_processing = "Ran that!" } after_processing { $after_processing = "Ran that too!" } around_processing ->(r, block) { block.call; $around_processing = "Ran that as well!" } @@ -10,7 +10,7 @@ class CallbackMailbox < ActionMailroom::Mailbox end end -class ActionMailroom::Mailbox::CallbacksTest < ActiveSupport::TestCase +class ActionMailbox::Base::CallbacksTest < ActiveSupport::TestCase setup do $before_processing = $after_processing = $around_processing = $processed = false @inbound_email = create_inbound_email_from_fixture("welcome.eml") diff --git a/test/unit/mailbox/routing_test.rb b/test/unit/mailbox/routing_test.rb index 4a8ed10eb0..320dee6aab 100644 --- a/test/unit/mailbox/routing_test.rb +++ b/test/unit/mailbox/routing_test.rb @@ -1,16 +1,16 @@ require_relative '../../test_helper' -class ApplicationMailbox < ActionMailroom::Mailbox +class ApplicationMailbox < ActionMailbox::Base routing "replies@example.com" => :replies end -class RepliesMailbox < ActionMailroom::Mailbox +class RepliesMailbox < ActionMailbox::Base def process $processed = mail.subject end end -class ActionMailroom::Mailbox::RoutingTest < ActiveSupport::TestCase +class ActionMailbox::Base::RoutingTest < ActiveSupport::TestCase setup do $processed = false @inbound_email = create_inbound_email_from_fixture("welcome.eml") @@ -22,7 +22,7 @@ class ActionMailroom::Mailbox::RoutingTest < ActiveSupport::TestCase end test "delayed routing" do - perform_enqueued_jobs only: ActionMailroom::RoutingJob do + perform_enqueued_jobs only: ActionMailbox::RoutingJob do another_inbound_email = create_inbound_email_from_fixture("welcome.eml", status: :pending) assert_equal "Discussion: Let's debate these attachments", $processed end diff --git a/test/unit/mailbox/state_test.rb b/test/unit/mailbox/state_test.rb index 6215e02837..32d16ca8fe 100644 --- a/test/unit/mailbox/state_test.rb +++ b/test/unit/mailbox/state_test.rb @@ -1,12 +1,12 @@ require_relative '../../test_helper' -class SuccessfulMailbox < ActionMailroom::Mailbox +class SuccessfulMailbox < ActionMailbox::Base def process $processed = mail.subject end end -class UnsuccessfulMailbox < ActionMailroom::Mailbox +class UnsuccessfulMailbox < ActionMailbox::Base rescue_from(RuntimeError) { $processed = :failure } def process @@ -14,7 +14,7 @@ class UnsuccessfulMailbox < ActionMailroom::Mailbox end end -class BouncingMailbox < ActionMailroom::Mailbox +class BouncingMailbox < ActionMailbox::Base def process $processed = :bounced bounced! @@ -22,7 +22,7 @@ class BouncingMailbox < ActionMailroom::Mailbox end -class ActionMailroom::Mailbox::StateTest < ActiveSupport::TestCase +class ActionMailbox::Base::StateTest < ActiveSupport::TestCase setup do $processed = false @inbound_email = create_inbound_email_from_mail \ -- cgit v1.2.3