X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6ffee1cf4be9b90bd8e807805ad59371c343de0d..90e46a58de583ac2bd7bb43077faa94186957a7a:/test/functional/way_controller_test.rb diff --git a/test/functional/way_controller_test.rb b/test/functional/way_controller_test.rb index bba13062c..a4b5a192a 100644 --- a/test/functional/way_controller_test.rb +++ b/test/functional/way_controller_test.rb @@ -4,6 +4,35 @@ require 'way_controller' class WayControllerTest < ActionController::TestCase api_fixtures + ## + # test all routes which lead to this controller + def test_routes + assert_routing( + { :path => "/api/0.6/way/create", :method => :put }, + { :controller => "way", :action => "create" } + ) + assert_routing( + { :path => "/api/0.6/way/1/full", :method => :get }, + { :controller => "way", :action => "full", :id => "1" } + ) + assert_routing( + { :path => "/api/0.6/way/1", :method => :get }, + { :controller => "way", :action => "read", :id => "1" } + ) + assert_routing( + { :path => "/api/0.6/way/1", :method => :put }, + { :controller => "way", :action => "update", :id => "1" } + ) + assert_routing( + { :path => "/api/0.6/way/1", :method => :delete }, + { :controller => "way", :action => "delete", :id => "1" } + ) + assert_routing( + { :path => "/api/0.6/ways", :method => :get }, + { :controller => "way", :action => "ways" } + ) + end + # ------------------------------------- # Test reading ways. # -------------------------------------