So I have a route that looks like this:
scope "4" do
scope "public" do
scope ":apikey" do
resources :shops
end
end
end
And a bunch of controller specs, an example of which looks like this:
describe ShopsController do
describe "when responding to a GET" do
context "#new" do
it "should create a new instance of the shop class" do
get :new
@shop.should_not_be_nil
end
end
end
end
In rake routes, as well as via a web browser, this controller/action
works fine. However, RSpec throws:
1) ShopsController when responding to a GET#new should create a new
instance of the shop class
Failure/Error: get :new
ActionController::RoutingError:
No route matches {:controller=>"shops", :action=>"new"}
# ./spec/controllers/shops_controller_spec.rb:9:in `block (4 levels)
in <top (required)>'
When I remove the scope statements from the route, the tests work
fine. Is there a way to "inform" RSpec of the route scopes?