私のルートは次のようになります
resources :stores, :except => [:destroy] do
resources :toys, :member => {:destroy => :delete}
end
私のオブジェクトコントローラーの仕様は次のようになります
require 'spec_helper'
describe ToysController do
describe "GET index" do
it "assigns all toys as @toys" do
toy11 = Factory(:toy, :is_shiny => true)
toy12 = Factory(:toy,:is_shiny => false)
get :index
assigns(:toys).should eq([toy12,toy11 ])
end
end
end
end
次のエラーが発生しました
Failure/Error: get :index
ActionController::RoutingError:
No route matches {:controller=>"toys"}
おもちゃのリソースはストア リソースの下にネストされているため、toys_path ルートを取得できないため、仕様が失敗していると思います。
どうすれば仕様に合格できますか?
ありがとう