email = ActionMailer::Base.deliveries.last
assert_equal trace.user.email, email.to[0]
assert_match(/success/, email.subject)
email = ActionMailer::Base.deliveries.last
assert_equal trace.user.email, email.to[0]
assert_match(/success/, email.subject)
email = ActionMailer::Base.deliveries.last
assert_equal trace.user.email, email.to[0]
assert_match(/failure/, email.subject)
email = ActionMailer::Base.deliveries.last
assert_equal trace.user.email, email.to[0]
assert_match(/failure/, email.subject)
end
def test_error_notification
# Check that the user gets a failure notification when something goes badly wrong
trace = create(:trace)
trace.stub(:import, -> { raise }) do
end
def test_error_notification
# Check that the user gets a failure notification when something goes badly wrong
trace = create(:trace)
trace.stub(:import, -> { raise }) do
email = ActionMailer::Base.deliveries.last
assert_equal trace.user.email, email.to[0]
assert_match(/failure/, email.subject)
email = ActionMailer::Base.deliveries.last
assert_equal trace.user.email, email.to[0]
assert_match(/failure/, email.subject)