module Jets::Testing::MailboxForHelper

Public Instance Methods

mails_for(user_or_email) click to toggle source
# File lib/jets/testing/helpers/mailbox_for_helper.rb, line 21
def mails_for(user_or_email)
  if ActionMailer::Base.delivery_method != :test
    raise "You can only use `mailbox` helper when" \
      "ActionMailer::Base.delivery_method is `:test`"
  end

  email = user_or_email.respond_to?(:email) ? user_or_email.email : user_or_email

  Mailbox.new(email)
end