Skip to content

Instantly share code, notes, and snippets.

@ClayShentrup
Last active January 26, 2018 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ClayShentrup/c818d6b445ede9a1b09fd91d0a412721 to your computer and use it in GitHub Desktop.
Save ClayShentrup/c818d6b445ede9a1b09fd91d0a412721 to your computer and use it in GitHub Desktop.
before(:each) do
ENV['SITE_DOMAIN'] = 'periscopedata.com'
end
after(:each) do
ENV.delete('SITE_DOMAIN')
ActionMailer::Base.deliveries.clear
end
def send_queued_mail_and_expect_subject_to_be(expected_subject)
expect(Delayed::Job.count).to eq(1)
Delayed::Job.first.invoke_job
mail = ActionMailer::Base.deliveries.last
expect(mail.to).to eq(['engineering+"everyone@periscopedata.com"@periscopedata.com'])
expect(mail.from).to eq(['everyone@periscopedata.com'])
expect(mail.subject.include?(expected_subject)).to be(true)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment