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?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to