[rspec-users] rspec route question

Matt Kolenda mkolenda at gmail.com
Thu Jul 15 19:24:28 EDT 2010


Hello

I'm having some trouble getting rspec to recognize a route.

# This works
describe "routes" do
      it "should have a route" do
        { :get => "/accounts/3/jobs/3/
applications/1/edit" }.should route_to(:controller => 'applications',
:action => 'edit', :id => "1", :account_id => "3", :job_id => "3" )
      end
    end

# This fails
    describe "#edit" do
      it "should respond to application/edit" do
         get "#{edit_account_job_application_path(@account.id, @job.id, @
application.id)}"
        response.should be_success
      end
  end

Here is the stack trace
1)
ActionController::RoutingError in 'ApplicationsController#edit should
respond to application/edit'
No route matches {:action=>"/accounts/23/jobs/
99/applications/299/edit", :controller=>"applications"}
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:419:in
`generate'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:352:in
`generate_extras'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:348:in
`extra_keys'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.4/lib/action_controller/test_process.rb:96:in
`assign_parameters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.4/lib/action_controller/test_process.rb:440:in
`process'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.4/lib/action_controller/test_process.rb:398:in
`get'
./spec/controllers/applications_controller_spec.rb:26:


Note that this route works fine at runtime in the browser.  Also rails is
able to resolve the route "edit_account_job_application_path".

I'm running rspec 1.3.0 and rspec-rails 1.3.2

Thanks in advance!

Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100715/50c271a4/attachment.html>


More information about the rspec-users mailing list