I want to test attachments with the Action Mailbox TestHelper. I see the options for the test helper get passed to the mail object but I can't seem to add attachments. They end up being nil.
This is what I have:
receive_inbound_email_from_mail(
attachments: [
File.new(File.join(File.dirname(__FILE__), '../support/fixtures/image.jpeg'))
],
from: '[email protected],
to: '[email protected]'
)
How does it work?
This is supported in Edge but ActionMailbox::TestHelper 6.0.3.2 has not implemented it yet.
As a workaround, I came up with this:
If you're using edge or a newer version this should work:
Note: You'll need to change the file path to suit your needs. And
receive_methods are the same ascreate_but they process the mail.