[rspec-users] RSpec and namespaced controllers

David Chelimsky dchelimsky at gmail.com
Sat Mar 24 15:37:01 EDT 2007


On 3/24/07, Bruno Bornsztein <bruno.bornsztein at gmail.com> wrote:
> I'm running into a problem with RSpec/Rails and namespaced controllers.
> I've got a controller called 'TenantsController' in app/controllers
> and another called 'Admin::TenantsController' in app/controllers/admin
>
> In spec/controllers/, I have a tenants_controller_spec.rb. In
> spec/controllers/admin/ I have another tenants_controller_spec.rb.
> Both specs run correctly when I run them individually from ruby (ie ruby
> spec/controllers/admin/tenants_controller.rb), but the
> namespaced tenants_controller.rb (inside /admin) fails when I run the tests
> from rake.
>
> I think there's a collision between the two controller name, or else
> RSpec/Rails isn't parsing the second controller's name correctly.
> For reference, in /admin/tenants_controller_spec.rb, I'm
> setting the controller_name as:
>
> controller_name 'admin/tenants'
>
> Any thoughts on what might be going wrong?

Does this work in rails built-in testing?

> Thanks,
> Bruno Bornsztein
> www.missingmethod.com
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list