From 6b7eac5c51cbef4acd1ab7f48884e7b614f71678 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Sat, 6 Oct 2018 22:02:08 -0400 Subject: Accept inbound emails from a variety of ingresses --- test/unit/controller_test.rb | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 test/unit/controller_test.rb (limited to 'test/unit/controller_test.rb') 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 -- cgit v1.2.3