diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2018-09-25 16:26:53 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2018-09-25 16:26:53 -0700 |
commit | 96b6e7ce669cf412f931e700fafc99d6d7ef031a (patch) | |
tree | 9a83e0abace43c641edb41ca8906e08049e24b28 /test | |
parent | 8eb239bd1a1350b151d57a639e589c68aed1f47a (diff) | |
download | rails-96b6e7ce669cf412f931e700fafc99d6d7ef031a.tar.gz rails-96b6e7ce669cf412f931e700fafc99d6d7ef031a.tar.bz2 rails-96b6e7ce669cf412f931e700fafc99d6d7ef031a.zip |
Extract and associate message_id with newly created inbound emails
Diffstat (limited to 'test')
-rw-r--r-- | test/dummy/db/migrate/20180208205311_create_action_mailroom_tables.rb | 1 | ||||
-rw-r--r-- | test/dummy/db/schema.rb | 1 | ||||
-rw-r--r-- | test/unit/inbound_email_test.rb | 10 |
3 files changed, 12 insertions, 0 deletions
diff --git a/test/dummy/db/migrate/20180208205311_create_action_mailroom_tables.rb b/test/dummy/db/migrate/20180208205311_create_action_mailroom_tables.rb index f488919138..cea05a6437 100644 --- a/test/dummy/db/migrate/20180208205311_create_action_mailroom_tables.rb +++ b/test/dummy/db/migrate/20180208205311_create_action_mailroom_tables.rb @@ -2,6 +2,7 @@ class CreateActionMailroomTables < ActiveRecord::Migration[5.2] def change create_table :action_mailroom_inbound_emails do |t| t.integer :status, default: 0, null: false + t.string :message_id t.datetime :created_at, precision: 6 t.datetime :updated_at, precision: 6 diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb index cf66062891..339a6b2afd 100644 --- a/test/dummy/db/schema.rb +++ b/test/dummy/db/schema.rb @@ -14,6 +14,7 @@ ActiveRecord::Schema.define(version: 2018_02_12_164506) do create_table "action_mailroom_inbound_emails", force: :cascade do |t| t.integer "status", default: 0, null: false + t.string "message_id" t.datetime "created_at", precision: 6 t.datetime "updated_at", precision: 6 end diff --git a/test/unit/inbound_email_test.rb b/test/unit/inbound_email_test.rb new file mode 100644 index 0000000000..3eedd60472 --- /dev/null +++ b/test/unit/inbound_email_test.rb @@ -0,0 +1,10 @@ +require_relative '../test_helper' + +module ActionMailroom + class InboundEmailTest < ActiveSupport::TestCase + 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 + end +end |