aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-12-12 17:12:48 -0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-12-12 17:12:48 -0800
commit0ef2fdb119a7196a010cd8081f1631f23f5cef95 (patch)
treea290dd9044b6f1298e59b081a5d7c877bbde16f5 /lib
parent6edccec1b97af46d2133ce701d7c307d213da9c6 (diff)
downloadrails-0ef2fdb119a7196a010cd8081f1631f23f5cef95.tar.gz
rails-0ef2fdb119a7196a010cd8081f1631f23f5cef95.tar.bz2
rails-0ef2fdb119a7196a010cd8081f1631f23f5cef95.zip
Consistent naming on all factory methods
Diffstat (limited to 'lib')
-rw-r--r--lib/action_mailbox/test_helper.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/action_mailbox/test_helper.rb b/lib/action_mailbox/test_helper.rb
index 23b2bb02ca..680e8b43be 100644
--- a/lib/action_mailbox/test_helper.rb
+++ b/lib/action_mailbox/test_helper.rb
@@ -5,14 +5,15 @@ module ActionMailbox
# Create an InboundEmail record using an eml fixture in the format of message/rfc822
# referenced with +fixture_name+ located in +test/fixtures/files/fixture_name+.
def create_inbound_email_from_fixture(fixture_name, status: :processing)
- create_inbound_email file_fixture(fixture_name).read, status: status
+ create_inbound_email_from_source file_fixture(fixture_name).read, status: status
end
def create_inbound_email_from_mail(status: :processing, **mail_options)
- create_inbound_email Mail.new(mail_options).to_s, status: status
+ create_inbound_email_from_source Mail.new(mail_options).to_s, status: status
end
- def create_inbound_email(source, status: :processing)
+ # Create an `InboundEmail` using the raw rfc822 `source` as text.
+ def create_inbound_email_from_source(source, status: :processing)
ActionMailbox::InboundEmail.create_and_extract_message_id! source, status: status
end
@@ -23,5 +24,8 @@ module ActionMailbox
def receive_inbound_email_from_mail(**kwargs)
create_inbound_email_from_mail(**kwargs).tap(&:route)
end
+ def receive_inbound_email_from_source(**kwargs)
+ create_inbound_email_from_source(**kwargs).tap(&:route)
+ end
end
end