Functional Test - assert_raise exception gives headache !

in one of my functional test, I check the followoing :

def test_user_should_not_show_documents
    login_as (:quentin)
    assert_raise (Exceptions::SecurityTransgression) { get :show, :id
=> 2, :franchise_id => 3 }

In my controller , I wrote :

  before_filter :login_required
  before_filter :find_parent
def show
   raise SecurityTransgression unless @parent.can_be_edited_by?
   @document = Document.find(params[:id].to_i)

I wrote the exception class and rescue action in my application.rb
class SecurityTransgression < StandardError; end

class ApplicationController < ActionController::Base
  include AuthenticatedSystem
  def rescue_action_locally(exception)
      case exception
      when ::Exceptions::SecurityTransgression
          render :file => "#{RAILS_ROOT}/public/403.html", :status =>

in testing, the exception is raised, (as @parent cannot be edited by
the current_user... I checked it...) the log gives a failure I cannot
explain :

1) Failure:
active_support/testing/setup_and_teardown.rb:67:in `__send__'
active_support/testing/setup_and_teardown.rb:67:in `run']:
<Exceptions::SecurityTransgression> exception expected but was
Class: <SecurityTransgression>
Message: <"SecurityTransgression">
documents_controller.rb:19:in `show'

the exception is expected, but ...

what could be the problem ?

Note : I am using the same assert_raise
(Exceptions::SecurityTransgression) in testing another controller
without any problem ...

thanks for your suggestions


got it... I forgot to write an Include Exceptions in my
where the SecurityTransgression is defined....