所以我有一条看起来像这样的路线:
scope "4" do
scope "public" do
scope ":apikey" do
resources :shops
end
end
end
Run Code Online (Sandbox Code Playgroud)
还有一堆控制器规格,其中一个例子如下:
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
Run Code Online (Sandbox Code Playgroud)
在rake路由中,以及通过Web浏览器,此控制器/操作正常工作.然而,RSpec抛出:
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 …Run Code Online (Sandbox Code Playgroud)