Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fguillen/388084 to your computer and use it in GitHub Desktop.
Save fguillen/388084 to your computer and use it in GitHub Desktop.
Integration Test for ExceptionNotifier
# Integration Test for ExceptionNotifier
# Please change this values for your own purposes:
# * UsersController
# * users_path
#
# Author: http://fernandoguillen.info
#
require 'test_helper'
class ExceptionNotifierTest < ActionController::IntegrationTest
def test_exception_notifier
UsersController.any_instance.expects(:local_request?).returns(false)
UsersController.any_instance.expects(:consider_all_requests_local).returns(false)
UsersController.any_instance.stubs(:index).raises( Exception.new( 'error') )
ActionMailer::Base.deliveries = []
get users_path
mail = ActionMailer::Base.deliveries.first
assert_not_nil( mail )
# test the mail attributes if you wish.
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment