在我的路线文件中,我有:
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'
,规范也会失败:
动作控制器::路由错误: 没有路线匹配“/订阅”