rails/actionmailbox/app
Dorian Marié ebf916af2e Fixes development Action Mailbox new mail form
I wanted to add a test for sending an attachment that is an empty string
and a file but got this error:

NoMethodError: undefined method `original_filename' for "#<Rack::Test::UploadedFile:0x000000010840d388>":String

Related: #44702

Fixes #45088

-----

Started POST "/rails/conductor/action_mailbox/inbound_emails" for ::1 at 2022-05-14 07:34:19 +0200
Processing by Rails::Conductor::ActionMailbox::InboundEmailsController#create as HTML
  Parameters: {"authenticity_token"=>"[FILTERED]", "mail"=>{"from"=>"", "to"=>"", "cc"=>"", "bcc"=>"", "x_original_to"=>"", "in_reply_to"=>"", "subject"=>"", "body"=>"", "attachments"=>[""]}, "commit"=>"Deliver inbound email"}
Completed 500 Internal Server Error in 7ms (ActiveRecord: 0.0ms | Allocations: 2600)

NoMethodError (undefined method `original_filename' for "":String

            mail.add_file(filename: attachment.original_filename, content: attachment.read)
                                              ^^^^^^^^^^^^^^^^^^):

actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:26:in `block (2 levels) in new_mail'
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:25:in `each'
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:25:in `block in new_mail'
<internal:kernel>:90:in `tap'
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:23:in `new_mail'
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:17:in `create'

Co-Authored-By: Patrício dos Santos <hello@psantos.dev>
2022-05-15 22:59:48 +02:00
..
controllers Fixes development Action Mailbox new mail form 2022-05-15 22:59:48 +02:00
jobs/action_mailbox Allow skipping incineration of processed emails 2019-02-06 19:28:49 -05:00
models/action_mailbox Instrument Action Mailbox processing 2022-03-09 10:06:43 +00:00
views Implement ActionMailbox incinerate in conductor 2021-06-24 15:35:56 -03:00