X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/b38343e5bd95230c6bb2159700102dbca247fa03..3666b674330ec8d14a224932a191d6121c5974e2:/test/controllers/api/old_nodes_controller_test.rb diff --git a/test/controllers/api/old_nodes_controller_test.rb b/test/controllers/api/old_nodes_controller_test.rb index 375a553b8..76e78ffad 100644 --- a/test/controllers/api/old_nodes_controller_test.rb +++ b/test/controllers/api/old_nodes_controller_test.rb @@ -17,6 +17,14 @@ module Api { :path => "/api/0.6/node/1/2", :method => :get }, { :controller => "api/old_nodes", :action => "version", :id => "1", :version => "2" } ) + assert_routing( + { :path => "/api/0.6/node/1/history.json", :method => :get }, + { :controller => "api/old_nodes", :action => "history", :id => "1", :format => "json" } + ) + assert_routing( + { :path => "/api/0.6/node/1/2.json", :method => :get }, + { :controller => "api/old_nodes", :action => "version", :id => "1", :version => "2", :format => "json" } + ) assert_routing( { :path => "/api/0.6/node/1/2/redact", :method => :post }, { :controller => "api/old_nodes", :action => "redact", :id => "1", :version => "2" } @@ -43,7 +51,7 @@ module Api basic_authorization private_user.email, "test" # setup a simple XML node - xml_doc = private_node.to_xml + xml_doc = xml_for_node(private_node) xml_node = xml_doc.find("//osm/node").first nodeid = private_node.id @@ -91,7 +99,7 @@ module Api # setup a simple XML node - xml_doc = node.to_xml + xml_doc = xml_for_node(node) xml_node = xml_doc.find("//osm/node").first nodeid = node.id @@ -156,8 +164,8 @@ module Api def check_not_found_id_version(id, version) get :version, :params => { :id => id, :version => version } assert_response :not_found - rescue ActionController::UrlGenerationError => ex - assert_match(/No route matches/, ex.to_s) + rescue ActionController::UrlGenerationError => e + assert_match(/No route matches/, e.to_s) end ##