rspecでrougingのテスト

調べてみると、route_for、route_to というマッチャがあるようで
現状どちらも動きます。
ですが、route_toを使いましょう、というのが結論。

route_for

ここみるとroute_for/params_forが紹介されています。
RSpec.info: Controllers

route_for(:controller => "hello", :action => "world").should == "/hello/world"
params_from(:get, "/hello/world").should == {:controller => "hello", :action => "world"}

route_to

Upgrade.rdocを見るとroute_for/params_fromは今日から使うな。と書いてあります。
Upgrade.rdoc at master from dchelimsky/rspec-rails - GitHub

    { :put => "/projects/37" }.should route_to(:controller => 'projects', :action => 'update', :id => '37')

    { :get => "/nonexisting_route" }.should_not be_routable

route_toの方が分かりやすい。
rdocにも下記のように記載があります。

Note that this method is obsoleted by the route_to matcher.

RSpec.info: Controllersのリンク直して欲しいな。