如何在rspec中测试路由错误?

aar*_*ona 2 ruby rspec ruby-on-rails controllers

我正在通过删除show动作来简化资源,因为它不需要.只需要列出,创建和编辑.我仍然SHOW在我的rspecs中测试它现在失败了(显然因为我已经添加了一个:except => [:show]到我的路由文件.

这就是我失败的原因:

1) CampaignsController GET show assigns the requested campaign as @campaign
     Failure/Error: get :show, {:id => campaign.to_param}, valid_session
     ActionController::RoutingError:
       No route matches {:id=>"458", :controller=>"campaigns", :action=>"show"}
     # ./spec/controllers/campaigns_controller_spec.rb:49:in `block (3 levels) in <top (required)>'

  2) CampaignsController routing routes to #show
     Failure/Error: expect(:get => "/campaigns/1").to route_to("campaigns#show", :id => "1")
       No route matches "/campaigns/1"
     # ./spec/routing/campaigns_routing_spec.rb:15:in `block (3 levels) in <top (required)>'
Run Code Online (Sandbox Code Playgroud)

如何让这些测试通过,以便我预计会出现路由错误?