diff --git a/lib/blacklight/routes.rb b/lib/blacklight/routes.rb index 6e6fdc93ee..c37d08c88b 100644 --- a/lib/blacklight/routes.rb +++ b/lib/blacklight/routes.rb @@ -102,6 +102,7 @@ def export(primary_resource) get "#{primary_resource}/email", :as => "email_#{primary_resource}" post "#{primary_resource}/email" get "#{primary_resource}/sms", :as => "sms_#{primary_resource}" + post "#{primary_resource}/sms" end end diff --git a/spec/routing/catalog_routing_spec.rb b/spec/routing/catalog_routing_spec.rb index ed7c02f83f..56e500bb4d 100644 --- a/spec/routing/catalog_routing_spec.rb +++ b/spec/routing/catalog_routing_spec.rb @@ -9,9 +9,12 @@ it "should have a path for sending the email" do expect(:post => "/catalog/email").to route_to(:controller => 'catalog', :action => 'email') end - it "should map {:controller => 'catalog', :action => 'sms'} to /catalog/sms" do + it "should map GET {:controller => 'catalog', :action => 'sms'} to /catalog/sms" do expect(:get => "/catalog/sms").to route_to(:controller => 'catalog', :action => 'sms') end + it "should map POST {:controller => 'catalog', :action => 'sms'} to /catalog/sms" do + expect(:post => "/catalog/sms").to route_to(:controller => 'catalog', :action => 'sms') + end it "should map { :controller => 'catalog', :action => 'show', :id => 666 } to /catalog/666" do expect(:get => "/catalog/666").to route_to(:controller => 'catalog', :action => 'show', :id => "666") end