Skip to content
  • Dorian Marié's avatar
    ebf916af
    Fixes development Action Mailbox new mail form · ebf916af
    Dorian Marié authored
    
    
    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: default avatarPatrício dos Santos <hello@psantos.dev>
    ebf916af
    Fixes development Action Mailbox new mail form
    Dorian Marié authored
    
    
    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: default avatarPatrício dos Santos <hello@psantos.dev>
Loading