Re: [rspec-users] Testing a nested controller

2007-09-14 Thread Jarkko Laine
On 14.9.2007, at 12.02, Andreas Wolff wrote: Hey everyone. I really stuck on testing a nested controller. I'm trying to make a request using get and afterwards checking the response by response.should ... My routes.rb looks like this: map.resources :writers do |writers| writers.resources :no

Re: [rspec-users] Testing a nested controller

2007-09-14 Thread Andreas Wolff
Ok. this was stupid :) I found the answer two minutes later: You cannot use the url helper here, but if you provide the writers id in the request everything works fine: testing the route: route_for(:controller => "notes", :action => "show", :id => 1, :writer_id => 1) testing the request by: get

[rspec-users] Testing a nested controller

2007-09-14 Thread Andreas Wolff
Hey everyone. I really stuck on testing a nested controller. I'm trying to make a request using get and afterwards checking the response by response.should ... My routes.rb looks like this: map.resources :writers do |writers| writers.resources :notes end In my notes_controller_spec.rb def do_