X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/1f8a68371ad34594cce4aadf5fef229588fd4ddc..7ff77d9d3d7960ae993bf5ef97a66dbb10f2496e:/test/functional/geocoder_controller_test.rb

diff --git a/test/functional/geocoder_controller_test.rb b/test/functional/geocoder_controller_test.rb
index f63fe518d..b678125d2 100644
--- a/test/functional/geocoder_controller_test.rb
+++ b/test/functional/geocoder_controller_test.rb
@@ -2,9 +2,57 @@ require File.dirname(__FILE__) + '/../test_helper'
 require 'geocoder_controller'
 
 class GeocoderControllerTest < ActionController::TestCase
+  ##
+  # test all routes which lead to this controller
+  def test_routes
+    assert_routing(
+      { :path => "/geocoder/search", :method => :post },
+      { :controller => "geocoder", :action => "search" }
+    )
+    assert_routing(
+      { :path => "/geocoder/search_latlon", :method => :get },
+      { :controller => "geocoder", :action => "search_latlon" }
+    )
+    assert_routing(
+      { :path => "/geocoder/search_us_postcode", :method => :get },
+      { :controller => "geocoder", :action => "search_us_postcode" }
+    )
+    assert_routing(
+      { :path => "/geocoder/search_uk_postcode", :method => :get },
+      { :controller => "geocoder", :action => "search_uk_postcode" }
+    )
+    assert_routing(
+      { :path => "/geocoder/search_ca_postcode", :method => :get },
+      { :controller => "geocoder", :action => "search_ca_postcode" }
+    )
+    assert_routing(
+      { :path => "/geocoder/search_osm_namefinder", :method => :get },
+      { :controller => "geocoder", :action => "search_osm_namefinder" }
+    )
+    assert_routing(
+      { :path => "/geocoder/search_osm_nominatim", :method => :get },
+      { :controller => "geocoder", :action => "search_osm_nominatim" }
+    )
+    assert_routing(
+      { :path => "/geocoder/search_geonames", :method => :get },
+      { :controller => "geocoder", :action => "search_geonames" }
+    )
 
-  # Replace this with your real tests.
-  def test_truth
-    assert true
+    assert_routing(
+      { :path => "/geocoder/description", :method => :post },
+      { :controller => "geocoder", :action => "description" }
+    )
+    assert_routing(
+      { :path => "/geocoder/description_osm_namefinder", :method => :get },
+      { :controller => "geocoder", :action => "description_osm_namefinder" }
+    )
+    assert_routing(
+      { :path => "/geocoder/description_osm_nominatim", :method => :get },
+      { :controller => "geocoder", :action => "description_osm_nominatim" }
+    )
+    assert_routing(
+      { :path => "/geocoder/description_geonames", :method => :get },
+      { :controller => "geocoder", :action => "description_geonames" }
+    )
   end
 end