Nei miei percorsi di file che ho:Come posso specificare il protocollo https nelle specifiche del routing con rspec?
resources :subscription, :only => [:show], :constraints => {:protocol => "https"}
Sto cercando di aggiungere una specifica per questa rotta in questo modo:
it "recognizes and generates #show" do
{ :get => "/subscription", :protocol => 'https' }.should route_to(:controller => "subscriptions", :action => "show")
end
Tuttavia, le specifiche non riesce ancora. Se rimuovo il :protocol => 'https'
, la specifica fallisce anche:
ActionController::RoutingError: No route matches "/subscription"
Per far funzionare tutto questo dovevo specificare il vincolo come '{protocol =>" https: // "}', non semplicemente '" https "' come ci si aspetterebbe. – cfeduke