-class OldNodeController < OldController
+class OldNodesController < OldController
private
def lookup_old_element
-class OldRelationController < OldController
+class OldRelationsController < OldController
private
def lookup_old_element
-class OldWayController < OldController
+class OldWaysController < OldController
private
def lookup_old_element
<%= render :partial => @type, :collection => @feature.send("old_#{@type}s").reverse %>
<div class='secondary-actions'>
- <%= link_to(t('browse.download_xml'), :controller => "old_#{@type}", :action => "history") %>
+ <%= link_to(t('browse.download_xml'), :controller => "old_#{@type.pluralize}", :action => "history") %>
·
<%= link_to(t('browse.view_details'), :action => @type) %>
</div>
put "node/create" => "nodes#create"
get "node/:id/ways" => "ways#ways_for_node", :id => /\d+/
get "node/:id/relations" => "relations#relations_for_node", :id => /\d+/
- get "node/:id/history" => "old_node#history", :id => /\d+/
- post "node/:id/:version/redact" => "old_node#redact", :version => /\d+/, :id => /\d+/
- get "node/:id/:version" => "old_node#version", :id => /\d+/, :version => /\d+/
+ get "node/:id/history" => "old_nodes#history", :id => /\d+/
+ post "node/:id/:version/redact" => "old_nodes#redact", :version => /\d+/, :id => /\d+/
+ get "node/:id/:version" => "old_nodes#version", :id => /\d+/, :version => /\d+/
get "node/:id" => "nodes#read", :id => /\d+/
put "node/:id" => "nodes#update", :id => /\d+/
delete "node/:id" => "nodes#delete", :id => /\d+/
get "nodes" => "nodes#nodes"
put "way/create" => "ways#create"
- get "way/:id/history" => "old_way#history", :id => /\d+/
+ get "way/:id/history" => "old_ways#history", :id => /\d+/
get "way/:id/full" => "ways#full", :id => /\d+/
get "way/:id/relations" => "relations#relations_for_way", :id => /\d+/
- post "way/:id/:version/redact" => "old_way#redact", :version => /\d+/, :id => /\d+/
- get "way/:id/:version" => "old_way#version", :id => /\d+/, :version => /\d+/
+ post "way/:id/:version/redact" => "old_ways#redact", :version => /\d+/, :id => /\d+/
+ get "way/:id/:version" => "old_ways#version", :id => /\d+/, :version => /\d+/
get "way/:id" => "ways#read", :id => /\d+/
put "way/:id" => "ways#update", :id => /\d+/
delete "way/:id" => "ways#delete", :id => /\d+/
put "relation/create" => "relations#create"
get "relation/:id/relations" => "relations#relations_for_relation", :id => /\d+/
- get "relation/:id/history" => "old_relation#history", :id => /\d+/
+ get "relation/:id/history" => "old_relations#history", :id => /\d+/
get "relation/:id/full" => "relations#full", :id => /\d+/
- post "relation/:id/:version/redact" => "old_relation#redact", :version => /\d+/, :id => /\d+/
- get "relation/:id/:version" => "old_relation#version", :id => /\d+/, :version => /\d+/
+ post "relation/:id/:version/redact" => "old_relations#redact", :version => /\d+/, :id => /\d+/
+ get "relation/:id/:version" => "old_relations#version", :id => /\d+/, :version => /\d+/
get "relation/:id" => "relations#read", :id => /\d+/
put "relation/:id" => "relations#update", :id => /\d+/
delete "relation/:id" => "relations#delete", :id => /\d+/
require "test_helper"
-require "old_node_controller"
-class OldNodeControllerTest < ActionController::TestCase
+class OldNodesControllerTest < ActionController::TestCase
#
# TODO: test history
#
def test_routes
assert_routing(
{ :path => "/api/0.6/node/1/history", :method => :get },
- { :controller => "old_node", :action => "history", :id => "1" }
+ { :controller => "old_nodes", :action => "history", :id => "1" }
)
assert_routing(
{ :path => "/api/0.6/node/1/2", :method => :get },
- { :controller => "old_node", :action => "version", :id => "1", :version => "2" }
+ { :controller => "old_nodes", :action => "version", :id => "1", :version => "2" }
)
assert_routing(
{ :path => "/api/0.6/node/1/2/redact", :method => :post },
- { :controller => "old_node", :action => "redact", :id => "1", :version => "2" }
+ { :controller => "old_nodes", :action => "redact", :id => "1", :version => "2" }
)
end
require "test_helper"
-require "old_relation_controller"
-class OldRelationControllerTest < ActionController::TestCase
+class OldRelationsControllerTest < ActionController::TestCase
##
# test all routes which lead to this controller
def test_routes
assert_routing(
{ :path => "/api/0.6/relation/1/history", :method => :get },
- { :controller => "old_relation", :action => "history", :id => "1" }
+ { :controller => "old_relations", :action => "history", :id => "1" }
)
assert_routing(
{ :path => "/api/0.6/relation/1/2", :method => :get },
- { :controller => "old_relation", :action => "version", :id => "1", :version => "2" }
+ { :controller => "old_relations", :action => "version", :id => "1", :version => "2" }
)
assert_routing(
{ :path => "/api/0.6/relation/1/2/redact", :method => :post },
- { :controller => "old_relation", :action => "redact", :id => "1", :version => "2" }
+ { :controller => "old_relations", :action => "redact", :id => "1", :version => "2" }
)
end
require "test_helper"
-require "old_way_controller"
-class OldWayControllerTest < ActionController::TestCase
+class OldWaysControllerTest < ActionController::TestCase
##
# test all routes which lead to this controller
def test_routes
assert_routing(
{ :path => "/api/0.6/way/1/history", :method => :get },
- { :controller => "old_way", :action => "history", :id => "1" }
+ { :controller => "old_ways", :action => "history", :id => "1" }
)
assert_routing(
{ :path => "/api/0.6/way/1/2", :method => :get },
- { :controller => "old_way", :action => "version", :id => "1", :version => "2" }
+ { :controller => "old_ways", :action => "version", :id => "1", :version => "2" }
)
assert_routing(
{ :path => "/api/0.6/way/1/2/redact", :method => :post },
- { :controller => "old_way", :action => "redact", :id => "1", :version => "2" }
+ { :controller => "old_ways", :action => "redact", :id => "1", :version => "2" }
)
end
check_ordering(doc, @response.body)
# check the ordering in the history tables:
- with_controller(OldRelationController.new) do
+ with_controller(OldRelationsController.new) do
get :version, :params => { :id => relation_id, :version => 2 }
assert_response :success, "can't read back version 2 of the relation #{relation_id}"
check_ordering(doc, @response.body)
check_ordering(doc, @response.body)
# check the ordering in the history tables:
- with_controller(OldRelationController.new) do
+ with_controller(OldRelationsController.new) do
get :version, :params => { :id => relation_id, :version => 1 }
assert_response :success, "can't read back version 1 of the relation: #{@response.body}"
check_ordering(doc, @response.body)
if ver.nil?
get :read, :params => { :id => id }
else
- with_controller(OldRelationController.new) do
+ with_controller(OldRelationsController.new) do
get :version, :params => { :id => id, :version => ver }
end
end