Hi guys,
My route file is as below.
==========================
Spree::Core::Engine.routes.prepend do
namespace :admin do
resources :question_categories
resources :questions
end
match :faq, to: 'faqs#index', as: 'faq'
end
===========================
I'm testing against routes and i have created a file under
spec/routing/extension_route_spec.rb having this code.
==========================
require 'spec_helper'
describe Spree::FaqsController do
it "routes to #index" do
expect(:get=>'/faq').to route_to(:controller => "spree/faqs",:action =>
"index")
end
end
=============================
But when i run my spec it gives me error "No Route matches"
Error:
1) Spree::FaqsController routes to #index
Failure/Error: expect(:get=>'/faq').to route_to(:controller =>
"spree/faqs",:action => "index")
No route matches "/faq"
# ./spec/routing/spree_faq_route_spec.rb:5:in `block (2 levels) in
<top (required)>'
Why my extension routes are not accessible by rspec. I'm new to Spree. any
help?
Thanks.