Reputation: 1190
I have the following routes.rb file (part):
resource :user do
resources :orders do
post :verify, :on => :collection
end
end
My controller spec looks like follows:
require 'spec_helper'
describe OrdersController do
describe "#verify" do
it "verifies a recipe" do
post :verify
end
end
end
The spec fails with an ActionController::RoutingError No route matches {:controller=>"orders", :action=>"verify"} even though the route exists and correctly responds in a browser.
Upvotes: 2
Views: 201
Reputation: 1190
Ah, my bad! I've completely forgot that I have the rails-translate-routes gem in place and I don't set a default locale!
Upvotes: 0
Reputation: 33161
Based on your routes, the describe should look like:
describe Users::OrdersController do
...
Upvotes: 1