Forked from fguillen/exception_notifier_integration_test.rb
Created
May 3, 2010 13:42
-
-
Save spejman/388101 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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