2018-12-14 05:06:12 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-12-24 15:16:22 -05:00
|
|
|
require_relative "../../test_helper"
|
2018-09-28 14:12:51 -04:00
|
|
|
|
2018-09-28 15:19:43 -04:00
|
|
|
class ActionMailbox::InboundEmail::MessageIdTest < ActiveSupport::TestCase
|
2018-09-28 14:12:51 -04:00
|
|
|
test "message id is extracted from raw email" do
|
|
|
|
inbound_email = create_inbound_email_from_fixture("welcome.eml")
|
|
|
|
assert_equal "0CB459E0-0336-41DA-BC88-E6E28C697DDB@37signals.com", inbound_email.message_id
|
|
|
|
end
|
|
|
|
|
|
|
|
test "message id is generated if its missing" do
|
2018-12-12 20:12:48 -05:00
|
|
|
inbound_email = create_inbound_email_from_source "Date: Fri, 28 Sep 2018 11:08:55 -0700\r\nTo: a@example.com\r\nMime-Version: 1.0\r\nContent-Type: text/plain\r\nContent-Transfer-Encoding: 7bit\r\n\r\nHello!"
|
2018-09-28 14:12:51 -04:00
|
|
|
assert_not_nil inbound_email.message_id
|
|
|
|
end
|
|
|
|
end
|