Allow POST requests to the home page so OpenSearch works

This commit is contained in:
Tom Hughes 2012-03-14 13:44:03 +00:00
parent 05aa7f377e
commit 21855aa355
2 changed files with 5 additions and 1 deletions

View file

@ -92,7 +92,7 @@ OpenStreetMap::Application.routes.draw do
match '/browse' => 'changeset#list', :via => :get match '/browse' => 'changeset#list', :via => :get
# web site # web site
root :to => 'site#index', :via => :get root :to => 'site#index', :via => [:get, :post]
match '/edit' => 'site#edit', :via => :get match '/edit' => 'site#edit', :via => :get
match '/copyright/:copyright_locale' => 'site#copyright', :via => :get match '/copyright/:copyright_locale' => 'site#copyright', :via => :get
match '/copyright' => 'site#copyright', :via => :get match '/copyright' => 'site#copyright', :via => :get

View file

@ -10,6 +10,10 @@ class SiteControllerTest < ActionController::TestCase
{ :path => "/", :method => :get }, { :path => "/", :method => :get },
{ :controller => "site", :action => "index" } { :controller => "site", :action => "index" }
) )
assert_routing(
{ :path => "/", :method => :post },
{ :controller => "site", :action => "index" }
)
assert_recognizes( assert_recognizes(
{ :controller => "site", :action => "index" }, { :controller => "site", :action => "index" },
{ :path => "/index.html", :method => :get } { :path => "/index.html", :method => :get }