mirror of https://github.com/rails/rails
Check all provided attributes of the message
This commit is contained in:
parent
c2c10f9262
commit
aac4d7f6ff
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue