2
votes

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.

2

2 Answers

1
votes

Based on your routes, the describe should look like:

describe Users::OrdersController do
  ...
0
votes

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!