I keep getting No route matches
error for a nested resource #create
action. Here is what I got:
routes:
...
resources :users, only: [:show, :create] do
resources :filters, only: [:new,:create]
end
...
controller spec:
...
context 'with valid attributes' do
it "creates new Filter" do
expect{
post :create, {:filter => attributes_for(:filter)}
}.to change(Filter, :count).by(1)
end
...
error:
No route matches {:action=>"create", :controller=>"filters", :filter=>{[long filter hash]}