I have a controller named Reports::Accountant::ApprovedTimeOffRequestsController. It's in the proper directory, and the class name is correct in the file its self. Rails console and unicorn load just fine, but rspec can't seem to load the file during testing.
Here's the error.
/Users/mdarby/.rvm/gems/ruby-1.9.3-p125-perf/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:503:in load_missing_constant': Expected /Users/mdarby/Documents/Code/ccw_32/app/controllers/reports/accountant/approved_time_off_requests_controller.rb to define Reports::Accountant::ApprovedTimeOffRequestsController (LoadError)
from /Users/mdarby/.rvm/gems/ruby-1.9.3-p125-perf/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:192:in block in const_missing'
This file was find on Rails 3.0 stack, but now that I've upgraded to 3.2/rspec 2.9 this is bombing out.
The definition of the class:
class Reports::Accountant::ApprovedTimeOffRequestsController < ApplicationController
EDIT:
If anyone comes across this, I solved it by removing the specs :)
I bet you're using Spork. I ran into this exact problem. I removed Spork and I was on my way. Give that a whack and let me know if it fixed it. Might be worth filing an issue on spork if that's the case.
Are you doing anything fancy with your tests? I had a case in the app itself where multiple threads were trying to load the same module. I can only guess that one marks it as loaded before it actually runs it, and then the constant isn't available to the next. In any case, my solution was to add a prepare block outside the threading.
development.rb (you might need this in test.rb)
ActionDispatch::Reloader.to_prepare do
Reports::Accountant::ApprovedTimeOffRequestsController
end