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? Thanks, Bruno Bornsztein www.missingmethod.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070324/e31bb651/attachment.html
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 >
Maybe Matching Threads
- Converting dot-namespaced Maildir to /-namespaced
- Spec''ing Namespaced Controllers
- Asking for last +1 for render :parial => @something in namespaced controllers patch
- Dealing with nested/namespaced classes w/ describe
- Singular resources namespaced by its slug (Routing)