]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/search_controller_test.rb
Reorganise tests to match modern rails test layout
[rails.git] / test / controllers / search_controller_test.rb
diff --git a/test/controllers/search_controller_test.rb b/test/controllers/search_controller_test.rb
new file mode 100644 (file)
index 0000000..c753047
--- /dev/null
@@ -0,0 +1,24 @@
+require 'test_helper'
+
+class SearchControllerTest < ActionController::TestCase
+  ##
+  # test all routes which lead to this controller
+  def test_routes
+    assert_routing(
+      { :path => "/api/0.6/search", :method => :get },
+      { :controller => "search", :action => "search_all" }
+    )
+    assert_routing(
+      { :path => "/api/0.6/nodes/search", :method => :get },
+      { :controller => "search", :action => "search_nodes" }
+    )
+    assert_routing(
+      { :path => "/api/0.6/ways/search", :method => :get },
+      { :controller => "search", :action => "search_ways" }
+    )
+    assert_routing(
+      { :path => "/api/0.6/relations/search", :method => :get },
+      { :controller => "search", :action => "search_relations" }
+    )
+  end
+end