在我的路由文件中,我有:
resources :subscription, :only => [:show], :constraints => {:protocol => "https"}
我正在尝试添加此路由的规范,方法如下:
it "recognizes and generates #show" do
{ :get => "/subscription", :protocol => 'https' }.should route_to(:controller => "subscriptions", :action => "show")
end
然而,规范仍然存在问题。 如果我删除
:protocol => 'https'
,规范也会失败:
ActionController :: RoutingError: 没有匹配的路由“/subscription”
{ protocol => "https://" }
,而不仅仅是像人们预期的那样使用"https"
。 - cfeduke