ruby on rails - Rspec Controller Test No Route Matches Error -


rspec not recognising controller routes. using versionist gem version api , using path version (so /v1/ version api shown below.).

constraints :subdomain => "api"   api_version(:module => "v1", :path => {:value => "v1"}, :defaults => {:format => :json}, :default => true)   match '/orders' => 'orders#index', :via => :get 

the route in rake routes shown as: get /v1/orders(.:format) v1/orders#index {:subdomain=>"api", :format=>:json}

my controller located in app/controller/v1/orders_controller.rb.

for rspec test, have orders_controller_spec.rb, have:

require 'spec_helper'  module v1   describe orderscontroller     describe "get #index"       "throws error on incorrect params"         :index       end     end   end end 

the error is:

 1) v1::ordersapicontroller #index throws error on incorrect param      failure/error: :index      actioncontroller::routingerror:        no route matches {:controller=>"v1/orders"} 

what wrong here? how come no route matches v1/orders? in rake routes, see route right there shown above: get /v1/orders(.:format) v1/orders#index {:subdomain=>"api", :format=>:json}. says get /v1/orders. problem here?


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -