I've just converted some existing rails tests to rspec, and now the tests that are in a namespace fail.
I.e. in the example below, AccountController spec passes, while the ChildrenController fails with the following error:
in `load_missing_constant': Expected /.../app/controllers/admin/children_controller.rb to define Admin::ChildrenController (LoadError)
app/controllers/account_controller.rb
class AccountController < ApplicationController
spec/controllers/account_controller_spec.rb
require 'spec_helper'
describe AccountController do
#...
end
app/controllers/admin/children_controller.rb
class Admin::ChildrenController < ApplicationController
spec/controllers/admin/children_controller_spec.rb
require 'spec_helper'
describe Admin::ChildrenController do
include ::ControllerHelper
#...
end
I'm using
- ruby-1.9.2-p0
- Rails 3.0.3
- rspec 2.3.0
I've tried playing with the namespace definitions, but no luck so far - any ideas???