Skip to content

Instantly share code, notes, and snippets.

@jimmynguyc
Last active April 19, 2023 10:03
Show Gist options
  • Save jimmynguyc/171b66c9ef800c93c9821fee9d6d693d to your computer and use it in GitHub Desktop.
Save jimmynguyc/171b66c9ef800c93c9821fee9d6d693d to your computer and use it in GitHub Desktop.
require "action_mailbox/test_helper"
include ActionMailer::TestHelper
ActionaMailbox::InboundEmail.last.destroy
# Example 1
# ==========
# We have an email that shows Manifested weight: 0.0 Kg
# But the actual weight is defined somewhere else
# E.g. The total chargeable weight on this shipment is
# 1555.0
bad_weight_email = File.read "spec/files/long_haul/mail_api/noa_emails/new_mailboxes/port_ams/air/ehub_ams/menzies_noa_email_no_weight.eml"
receive_inbound_email_from_source (bad_weight_email)
# Example 2
# =========
# We something receive email as attachment and it's in base64
base64_email = File.read "spec/files/long_haul/mail_api/noa_emails/new_mailboxes/port_ams/air/ehub_ams/menzies_wrong_body.eml"
receive_inbound_email_from_source (base64_email)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment