Module: EmailSpec::MailerDeliveries
- Included in:
- Deliveries
- Defined in:
- lib/email_spec/deliveries.rb
Instance Method Summary collapse
- #all_emails ⇒ Object
- #last_email_sent ⇒ Object
- #mailbox_for(address) ⇒ Object
- #reset_mailer ⇒ Object
Instance Method Details
#all_emails ⇒ Object
3 4 5 |
# File 'lib/email_spec/deliveries.rb', line 3 def all_emails deliveries end |
#last_email_sent ⇒ Object
7 8 9 |
# File 'lib/email_spec/deliveries.rb', line 7 def last_email_sent deliveries.last || raise("No email has been sent!") end |
#mailbox_for(address) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/email_spec/deliveries.rb', line 15 def mailbox_for(address) deliveries.select { |email| (email.to && email.to.include?(address)) || (email.bcc && email.bcc.include?(address)) || (email.cc && email.cc.include?(address)) } end |
#reset_mailer ⇒ Object
11 12 13 |
# File 'lib/email_spec/deliveries.rb', line 11 def reset_mailer deliveries.clear end |