From b3919d01554d31c5486d17332f4a4dde89a23239 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Thu, 18 Oct 2018 10:23:17 -0400 Subject: Don't require Postfix to send form data --- lib/action_mailbox/test_helper.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lib/action_mailbox/test_helper.rb') diff --git a/lib/action_mailbox/test_helper.rb b/lib/action_mailbox/test_helper.rb index b1d7af33f9..23b2bb02ca 100644 --- a/lib/action_mailbox/test_helper.rb +++ b/lib/action_mailbox/test_helper.rb @@ -5,18 +5,15 @@ module ActionMailbox # 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_from_fixture(fixture_name, status: :processing) - create_inbound_email file_fixture(fixture_name), filename: fixture_name, status: status + create_inbound_email file_fixture(fixture_name).read, status: status end def create_inbound_email_from_mail(status: :processing, **mail_options) - raw_email = Tempfile.new.tap { |raw_email| raw_email.write Mail.new(mail_options).to_s } - create_inbound_email(raw_email, status: status) + create_inbound_email Mail.new(mail_options).to_s, status: status end - def create_inbound_email(io, filename: 'mail.eml', status: :processing) - ActionMailbox::InboundEmail.create_and_extract_message_id! \ - ActionDispatch::Http::UploadedFile.new(tempfile: io, filename: filename, type: 'message/rfc822'), - status: status + def create_inbound_email(source, status: :processing) + ActionMailbox::InboundEmail.create_and_extract_message_id! source, status: status end def receive_inbound_email_from_fixture(*args) -- cgit v1.2.3