我想在我的 rspec 调用中传递一个命名变量来匹配
这是路线:
match '/api/get-pairings/:global_id' => 'api#get_pairings', :as => :get_pairings
这就是我拥有但不起作用的东西:
it "should get pairings for a specific id" do
{:get => get_pairings_path, :global_id => 1000 }.should route_to(:controller => "api", :action => "get_pairings")
{:get => get_pairings_path, :params => { :global_id => 1000 } }.should route_to(:controller => "api", :action => "get_pairings")
end
有任何想法吗?
提前谢谢