]> git.openstreetmap.org Git - rails.git/commitdiff
Add basic tests for the directions controller
authorTom Hughes <tom@compton.nu>
Sat, 7 Feb 2015 12:02:42 +0000 (12:02 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 7 Feb 2015 12:02:42 +0000 (12:02 +0000)
test/controllers/directions_controller_test.rb [new file with mode: 0644]

diff --git a/test/controllers/directions_controller_test.rb b/test/controllers/directions_controller_test.rb
new file mode 100644 (file)
index 0000000..f24c9d2
--- /dev/null
@@ -0,0 +1,21 @@
+require 'test_helper'
+
+class DirectionsControllerTest < ActionController::TestCase
+
+  ##
+  # test all routes which lead to this controller
+  def test_routes
+    assert_routing(
+      { :path => "/directions", :method => :get },
+      { :controller => "directions", :action => "search" }
+    )
+  end
+
+  ###
+  # test the search action
+  def test_search
+    get :search
+    assert_response :success
+  end
+
+end