[rspec-users] Route failure with Rails2.3 and rspec1.2

Peer Allan Peer.Allan at canadadrugs.com
Mon Mar 16 22:22:51 EDT 2009

Hello all,

I have a spec for a route that used to pass under Rails 2.2.2 and rspec
1.1.12, but can¹t figure out what is wrong since I updated. Here is the

          :controller         => 'purchase_orders',
          :action             => 'update',
          :company_id         => "32",
          :id                 => '1'
        }).should == "/companies/32/purchase_orders/1"

Which results in this failure

Test::Unit::AssertionFailedError in 'PurchaseOrdersController route
generation routes #update to /companies/32/purchase_orders/1'
The recognized options <{"action"=>"show",
 "company_id"=>"company-name"}> did not match <{"action"=>"update",
 "company_id"=>"company-name"}>, difference: <{"action"=>"update"}>

As you may have guessed the route is defined like so:

Map.resources :companies do |c|
  c.resources :purchase_orders

Any ideas?

Peer Allan

More information about the rspec-users mailing list