From 26bfd1c59cf2dfa36fc02b87831449a8259c780e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 18 Sep 2018 17:28:35 -0700 Subject: Only deliver pending emails to the mailroom Makes it easier to test without triggering this behavior. --- lib/action_mailroom/test_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/action_mailroom/test_helper.rb b/lib/action_mailroom/test_helper.rb index af9e3ad559..94321ecad3 100644 --- a/lib/action_mailroom/test_helper.rb +++ b/lib/action_mailroom/test_helper.rb @@ -2,8 +2,8 @@ module ActionMailroom module TestHelper # Create an InboundEmail record using an eml fixture in the format of message/rfc822 # referenced with +fixture_name+ located in +test/fixtures/files/fixture_name+. - def create_inbound_email(fixture_name) - ActionMailroom::InboundEmail.create!.tap do |inbound_email| + def create_inbound_email(fixture_name, status: :processing) + ActionMailroom::InboundEmail.create!(status: status).tap do |inbound_email| inbound_email.raw_email.attach \ ActiveStorage::Blob.create_after_upload! \ io: file_fixture(fixture_name).open, filename: fixture_name, content_type: 'message/rfc822' -- cgit v1.2.3