aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-10-18 10:23:17 -0400
committerGeorge Claghorn <george@basecamp.com>2018-10-18 10:23:17 -0400
commitb3919d01554d31c5486d17332f4a4dde89a23239 (patch)
tree42a4bcacda5f7e88824487b269e2893a96422333 /lib
parent88227658217ee82af7516d6a8013a6c04f037073 (diff)
downloadrails-b3919d01554d31c5486d17332f4a4dde89a23239.tar.gz
rails-b3919d01554d31c5486d17332f4a4dde89a23239.tar.bz2
rails-b3919d01554d31c5486d17332f4a4dde89a23239.zip
Don't require Postfix to send form data
Diffstat (limited to 'lib')
-rw-r--r--lib/action_mailbox/test_helper.rb11
1 files changed, 4 insertions, 7 deletions
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)