Reputation: 375
I have set up the path in route.rb as the following: post "/orders/:id/capture/.:format"
but when I write the controller's rspec post "capture"
I got error: "can't find route {:controller => :orders, :action => :capture}
why is that?
Upvotes: 1
Views: 317
Reputation: 5314
It is most likely because you are not passing in the order's id.
The route will not match unless all criteria are met.
In your code you have
post "capture", :order => @order, :format => :json
Is @order set?
Upvotes: 1