diff options
Diffstat (limited to 'lib/action_mailbox')
-rw-r--r-- | lib/action_mailbox/test_helper.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/action_mailbox/test_helper.rb b/lib/action_mailbox/test_helper.rb index 65a15a1281..4694f61b8a 100644 --- a/lib/action_mailbox/test_helper.rb +++ b/lib/action_mailbox/test_helper.rb @@ -6,7 +6,7 @@ module ActionMailbox # 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 - end + 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 } @@ -18,5 +18,9 @@ module ActionMailbox ActionDispatch::Http::UploadedFile.new(tempfile: io, filename: filename, type: 'message/rfc822'), status: status end + + def receive_inbound_email_from_mail(**kwargs) + create_inbound_email_from_mail(**kwargs).tap(&:route) + end end end |