我有以下 rspec 路由规范,但我需要:defaults => { :format => 'json' }
在帖子中指定;我该怎么做?
规格:
it "should route to all-locations-nav" do
{:post => locations_nav_path }.should route_to(:controller => "api", :action => "locations_nav")
end
编辑#1
所以玩,它看起来像这样修复它:
it "should route to all-locations-nav" do
{:post => locations_nav_path }.should route_to(:controller => "api", :action => "locations_nav", :format => "json")
end
但很好奇这是否记录在任何地方?