aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-10-01 15:42:32 -0400
committerGeorge Claghorn <george@basecamp.com>2018-10-01 15:42:35 -0400
commit704179251f3a96f7e7f2ed9b28e1524ace3a4927 (patch)
tree620db65f73edd88372dfbd5d79aee3ef69b90e7a /app
parentdd593b98b5ef6e66d72942065dd1c0a9b266b9bc (diff)
downloadrails-704179251f3a96f7e7f2ed9b28e1524ace3a4927.tar.gz
rails-704179251f3a96f7e7f2ed9b28e1524ace3a4927.tar.bz2
rails-704179251f3a96f7e7f2ed9b28e1524ace3a4927.zip
Add a test helper for creating and routing an inbound email
Diffstat (limited to 'app')
-rw-r--r--app/jobs/action_mailbox/routing_job.rb2
-rw-r--r--app/models/action_mailbox/inbound_email/routable.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/app/jobs/action_mailbox/routing_job.rb b/app/jobs/action_mailbox/routing_job.rb
index a2618bb8aa..af4aa9f8fa 100644
--- a/app/jobs/action_mailbox/routing_job.rb
+++ b/app/jobs/action_mailbox/routing_job.rb
@@ -2,6 +2,6 @@ class ActionMailbox::RoutingJob < ActiveJob::Base
queue_as :action_mailbox_routing
def perform(inbound_email)
- ApplicationMailbox.route inbound_email
+ inbound_email.route
end
end
diff --git a/app/models/action_mailbox/inbound_email/routable.rb b/app/models/action_mailbox/inbound_email/routable.rb
index 1928f9e387..48b357af45 100644
--- a/app/models/action_mailbox/inbound_email/routable.rb
+++ b/app/models/action_mailbox/inbound_email/routable.rb
@@ -8,4 +8,8 @@ module ActionMailbox::InboundEmail::Routable
def route_later
ActionMailbox::RoutingJob.perform_later self
end
+
+ def route
+ ApplicationMailbox.route self
+ end
end