0
我想傳遞一個命名變量在我的RSpec調用匹配如何通過通過要求規格
這是路線得到變量:
match '/api/get-pairings/:global_id' => 'api#get_pairings', :as => :get_pairings
這是我沒有按,但是」 t工作:
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
任何想法?
THX提前
怎麼樣':GET => get_pairings_path(:global_id => 1000)'? –