libフォルダーにこのモジュールがあります:
module Exceptions
class NotAuthorized < StandardError
end
end
次に、次のようなコントローラーのテストがあります。
class Admin::ApplicationControllerTest < ActionController::TestCase
test "should not be authorized" do
assert_raise(Exceptions::NotAuthorized) {
get :index
}
end
end
また、この行を自分の環境/test.rbに配置しようとしています
config.autoload_paths +=%W(#{config.root}/lib)
しかし、テストを実行すると、常に次のようになります。
NameError: unitialized constant Admin::ApplicationControllerTest::Exceptions
モジュール Exceptions をテストに含める方法は?