aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-09-18 16:07:06 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-09-18 16:07:06 -0700
commit4a9b45ce2214573de29eed694e4416d46642244f (patch)
tree59e5627535773b8d0d15ae1867429871fe5df0b3 /test
parent65a6d525c6ce36acefd4b1918bbc5f14132e7810 (diff)
downloadrails-4a9b45ce2214573de29eed694e4416d46642244f.tar.gz
rails-4a9b45ce2214573de29eed694e4416d46642244f.tar.bz2
rails-4a9b45ce2214573de29eed694e4416d46642244f.zip
Use a test helper to create fixtures rather than rely on them being predefined
Too much hassle to manage all the steps compared to just pointing to an .eml fixture and having it setup for you.
Diffstat (limited to 'test')
-rw-r--r--test/test_helper.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 9344a57fd7..c05cc87896 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -20,13 +20,8 @@ if ActiveSupport::TestCase.respond_to?(:fixture_path=)
ActiveSupport::TestCase.fixtures :all
end
+require "action_mailroom/test_helper"
+
class ActiveSupport::TestCase
- private
- def create_inbound_email(fixture_name)
- ActionMailroom::InboundEmail.create!.tap do |inbound_email|
- inbound_email.raw_email.attach \
- ActiveStorage::Blob.create_after_upload! \
- io: file_fixture(fixture_name).open, filename: fixture_name, content_type: 'message/rfc822'
- end
- end
+ include ActionMailroom::TestHelper
end