diff options
author | George Claghorn <george@basecamp.com> | 2019-01-19 11:49:50 -0500 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2019-01-19 11:49:50 -0500 |
commit | aac4d7f6ff5fad462cec2a521e1b98774ef3bdb2 (patch) | |
tree | d2808fd8ac54139f9b68e9ccfa9d393a09c041dd /actionmailbox | |
parent | c2c10f9262ba00eb9b26632d8ee4b208627f88dd (diff) | |
download | rails-aac4d7f6ff5fad462cec2a521e1b98774ef3bdb2.tar.gz rails-aac4d7f6ff5fad462cec2a521e1b98774ef3bdb2.tar.bz2 rails-aac4d7f6ff5fad462cec2a521e1b98774ef3bdb2.zip |
Check all provided attributes of the message
Diffstat (limited to 'actionmailbox')
-rw-r--r-- | actionmailbox/test/controllers/rails/action_mailbox/inbound_emails_controller_test.rb | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/actionmailbox/test/controllers/rails/action_mailbox/inbound_emails_controller_test.rb b/actionmailbox/test/controllers/rails/action_mailbox/inbound_emails_controller_test.rb index 9da1c04303..fcd9ad839f 100644 --- a/actionmailbox/test/controllers/rails/action_mailbox/inbound_emails_controller_test.rb +++ b/actionmailbox/test/controllers/rails/action_mailbox/inbound_emails_controller_test.rb @@ -10,15 +10,19 @@ class Rails::Conductor::ActionMailbox::InboundEmailsControllerTest < ActionDispa mail: { from: "Jason Fried <jason@37signals.com>", to: "Replies <replies@example.com>", - bcc: "", in_reply_to: "<4e6e35f5a38b4_479f13bb90078178@small-app-01.mail>", - subject: "Create", - body: "New Mail" + subject: "Hey there", + body: "How's it going?" } } end - assert_equal "New Mail", ActionMailbox::InboundEmail.last.mail.decoded + mail = ActionMailbox::InboundEmail.last.mail + assert_equal %w[ jason@37signals.com ], mail.from + assert_equal %w[ replies@example.com ], mail.to + assert_equal "4e6e35f5a38b4_479f13bb90078178@small-app-01.mail", mail.in_reply_to + assert_equal "Hey there", mail.subject + assert_equal "How's it going?", mail.body.decoded end end @@ -29,18 +33,16 @@ class Rails::Conductor::ActionMailbox::InboundEmailsControllerTest < ActionDispa mail: { from: "Jason Fried <jason@37signals.com>", to: "Replies <replies@example.com>", - bcc: "", - in_reply_to: "<4e6e35f5a38b4_479f13bb90078178@small-app-01.mail>", - subject: "Discussion: Let's debate these attachments", + subject: "Let's debate some attachments", body: "Let's talk about these images:", - attachments: [fixture_file_upload("files/avatar1.jpeg"), fixture_file_upload("files/avatar2.jpeg")] + attachments: [ fixture_file_upload("files/avatar1.jpeg"), fixture_file_upload("files/avatar2.jpeg") ] } } end mail = ActionMailbox::InboundEmail.last.mail - assert_equal 2, mail.attachments.size assert_equal "Let's talk about these images:", mail.text_part.decoded + assert_equal 2, mail.attachments.count end end |