New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't seem to match nested routes #273
Comments
Keep in mind that rspec-rails is a thin wrapper for Rails' own testing framework. What happens if you do the same thing in a Rails functional test?
|
I stumbled on the same problem just minutes ago. You were right David, it seems to be a rails issue. Here is the output of the unit test you proposed, just in case I missed something ruby -I. functional/activities_controller_test.rb 2010-12-01 12:24:28
/action_dispatch/routing/route_set.rb:424:in `raise_routing_error' /action_dispatch/routing/route_set.rb:406:in 1 tests, 0 assertions, 0 failures, 1 errors, 0 skips Test run options: --seed 52769 Here is the setup Using rake (0.8.7) |
Please forgive, and forget, the mess above This is more readable: I stumbled on the same problem just minutes ago. You were right David, it seems to be a rails issue. Here is the output of the unit test you proposed, just in case I missed something |
Please raise this issue in the rails tracker if it's not already there: |
I am also able to duplicate the problem, I will bubble this up to rails after work(unless someone is really excited and does it before then). David and Robert, thanks for your help! |
redirect "thanks", :to => "David" I just created the ticket. https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6097-testing-nested-routes |
Just a taught though get :index cannot work on a nested route, are we aware of this? get :index, <name_of_parent>_id => 42 right? Cheers |
Any resolution on this? |
When setting up a basic rails 3 application it seems like rspec-rails is unable to test nested routes. I've included a basic setup that should enable anyone to reproduce the error. This is present on both 2.1.0 and on master. One quick work around is to create a route directly to the controller.
routes.rb :
one_controller_spec.rb :
one_controller.rb :
The text was updated successfully, but these errors were encountered: