I have a Page class with a StaticPage subclass.
I want to test that I can access a route for new static pages in RSPEC.
routes:
resources :sites do
resources :pages, only: [:index, :destroy]
resources :static_pages, except: :show, controller: "pages", type: "StaticPage"
spec:
describe 'GET :new' do
it 'assigns @page' do
expect(@page).to_not be_nil
end
end
fails
How do I test GET :new
new_organization_site_static_page GET /organizations/:organization_id/sites/:site_id/static_pages/new(.:format) pages#new {:type=>"StaticPage"}
in RSPEC.