Skip to content

Instantly share code, notes, and snippets.

@AJFaraday
Created June 1, 2012 09:25
Show Gist options
  • Save AJFaraday/2850705 to your computer and use it in GitHub Desktop.
Save AJFaraday/2850705 to your computer and use it in GitHub Desktop.
# auth controller
def login
...
rescue Exception=> ex
logger.error ex.message
logger.info ex.backtrace.join("\n")
clear_session
flash[:warning] = "Incorrect login or password."
# in coverage and debugger, this line is not being called!?!
render :action => 'login', :layout=> 'simple'
end
# auth controller testst
def test_login_exception
assert_raise(NoMethodError){@controller.send(:login)}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment