diff options
author | George Claghorn <george@basecamp.com> | 2018-10-06 22:02:08 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-10-11 12:51:13 -0400 |
commit | 6b7eac5c51cbef4acd1ab7f48884e7b614f71678 (patch) | |
tree | 8eb6b0ebee4ad6073f6cb48b3effc60d4262d2f2 /test/unit | |
parent | 47445511862a4c9979fb46889011edf585391091 (diff) | |
download | rails-6b7eac5c51cbef4acd1ab7f48884e7b614f71678.tar.gz rails-6b7eac5c51cbef4acd1ab7f48884e7b614f71678.tar.bz2 rails-6b7eac5c51cbef4acd1ab7f48884e7b614f71678.zip |
Accept inbound emails from a variety of ingresses
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/controller_test.rb | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/test/unit/controller_test.rb b/test/unit/controller_test.rb deleted file mode 100644 index 508e561244..0000000000 --- a/test/unit/controller_test.rb +++ /dev/null @@ -1,27 +0,0 @@ -require_relative '../test_helper' - -class ActionMailbox::InboundEmailsControllerTest < ActionDispatch::IntegrationTest - test "receiving a valid RFC 822 message" do - assert_difference -> { ActionMailbox::InboundEmail.count }, +1 do - post_inbound_email "welcome.eml" - end - - assert_response :created - - inbound_email = ActionMailbox::InboundEmail.last - assert_equal file_fixture('../files/welcome.eml').read, inbound_email.raw_email.download - end - - test "rejecting a message of an unsupported type" do - assert_no_difference -> { ActionMailbox::InboundEmail.count } do - post rails_inbound_emails_url, params: { message: fixture_file_upload('files/text.txt', 'text/plain') } - end - - assert_response :unsupported_media_type - end - - private - def post_inbound_email(fixture_name) - post rails_inbound_emails_url, params: { message: fixture_file_upload("files/#{fixture_name}", 'message/rfc822') } - end -end |