Skip to content

Instantly share code, notes, and snippets.

@ClayShentrup
Last active Jan 26, 2018
Embed
What would you like to do?
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