Module: RSpec::Rails::MailboxExampleGroup
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
ActionMailbox::TestHelper,
ActiveSupport::Concern
|
|
Defined in: | rspec-rails/lib/rspec/rails/example/mailbox_example_group.rb |
Overview
Container module for mailbox spec functionality.
Class Method Summary
-
.create_inbound_email(_arg)
Internal use only
See additional method definition at line 13.
Instance Method Summary
-
#have_been_delivered
Passes if the inbound email was delivered.
-
#have_bounced
Passes if the inbound email bounced during processing.
-
#have_failed
Passes if the inbound email failed to process.
-
#process(message) ⇒ ActionMailbox::InboundMessage
Process an inbound email message directly, bypassing routing.
DSL Calls
included
[ GitHub ]34 35 36
# File 'rspec-rails/lib/rspec/rails/example/mailbox_example_group.rb', line 34
included do subject { described_class } end
Class Method Details
.create_inbound_email(_arg)
This method is for internal use only.
See additional method definition at line 13.
# File 'rspec-rails/lib/rspec/rails/example/mailbox_example_group.rb', line 22
def self.create_inbound_email(arg) case arg when Hash create_inbound_email_from_mail(**arg) else create_inbound_email_from_source(arg.to_s) end end
Instance Method Details
#have_been_delivered
Passes if the inbound email was delivered
# File 'rspec-rails/lib/rspec/rails/example/mailbox_example_group.rb', line 44
def have_been_delivered satisfy('have been delivered', &:delivered?) end
#have_bounced
Passes if the inbound email bounced during processing
# File 'rspec-rails/lib/rspec/rails/example/mailbox_example_group.rb', line 54
def have_bounced satisfy('have bounced', &:bounced?) end
#have_failed
Passes if the inbound email failed to process
# File 'rspec-rails/lib/rspec/rails/example/mailbox_example_group.rb', line 64
def have_failed satisfy('have failed', &:failed?) end
#process(message) ⇒ ActionMailbox::InboundMessage
Process an inbound email message directly, bypassing routing.
# File 'rspec-rails/lib/rspec/rails/example/mailbox_example_group.rb', line 73
def process( ) MailboxExampleGroup.create_inbound_email( ).tap do |mail| self.class.mailbox_class.receive(mail) end end