Environment
Ruby 2.2.1, Rails 4.2.0, rspec-core 3.2.2, rspec-wait 3.2.0, rspec-mocks 3.2.1, rspec-rails 3.2.1, support for rspec 3.2.2
I have the following method
def send_event_alert_email(event_id) event = Event.find_by(id: event_id) ... ... ... EventAlertMailer.event_alert(event_id).deliver_now create_alert(event) end
I need to write specifications that ensure that create_alert(event) will not be called when EventAlertMailer.event_alert(event_id).deliver_now raises any exceptions. So, the main question is how do I model deliver_now to raise possible exceptions that it could actually fulfill.
source share