From 4a9f2a746e855cf9f7169c8b7ed7563422bb08d6 Mon Sep 17 00:00:00 2001 From: Kyle Zhao Date: Tue, 9 Apr 2019 00:38:50 -0400 Subject: FIX: ActionMailbox test helper argument list `receive_inbound_email_from_source` should accept an argument list (`*args`) instead, to allow for the `source` argument in `create_inbound_email_from_source`. ```ruby receive_inbound_email_from_source(source, status: :processing) ``` Accepting a keyword argument list (`**kwargs`) results in an `ArgumentError` ```text ArgumentError: wrong number of arguments (given 1, expected 0) ``` --- actionmailbox/lib/action_mailbox/test_helper.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'actionmailbox') diff --git a/actionmailbox/lib/action_mailbox/test_helper.rb b/actionmailbox/lib/action_mailbox/test_helper.rb index 0ec9152844..d248fa8734 100644 --- a/actionmailbox/lib/action_mailbox/test_helper.rb +++ b/actionmailbox/lib/action_mailbox/test_helper.rb @@ -29,16 +29,16 @@ module ActionMailbox create_inbound_email_from_fixture(*args).tap(&:route) end - # Create an +InboundEmail+ from fixture using the same arguments as +create_inbound_email_from_mail+ - # and immediately route it to processing. + # Create an +InboundEmail+ using the same arguments as +create_inbound_email_from_mail+ and immediately route it to + # processing. def receive_inbound_email_from_mail(**kwargs) create_inbound_email_from_mail(**kwargs).tap(&:route) end - # Create an +InboundEmail+ from fixture using the same arguments as +create_inbound_email_from_source+ - # and immediately route it to processing. - def receive_inbound_email_from_source(**kwargs) - create_inbound_email_from_source(**kwargs).tap(&:route) + # Create an +InboundEmail+ using the same arguments as +create_inbound_email_from_source+ and immediately route it + # to processing. + def receive_inbound_email_from_source(*args) + create_inbound_email_from_source(*args).tap(&:route) end end end -- cgit v1.2.3