X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/361dcbb1dfd05c09034ed92da9bbf4305fcb8da9..a6e614e44e0735160c8d9ca9e3b43fd295e7e514:/test/controllers/api/relations_controller_test.rb diff --git a/test/controllers/api/relations_controller_test.rb b/test/controllers/api/relations_controller_test.rb index 803a57acf..4dd38fc3f 100644 --- a/test/controllers/api/relations_controller_test.rb +++ b/test/controllers/api/relations_controller_test.rb @@ -42,10 +42,6 @@ module Api { :controller => "api/relations", :action => "destroy", :id => "1" } ) - assert_routing( - { :path => "/api/0.6/node/1/relations", :method => :get }, - { :controller => "api/relations", :action => "relations_for_node", :id => "1" } - ) assert_routing( { :path => "/api/0.6/way/1/relations", :method => :get }, { :controller => "api/relations", :action => "relations_for_way", :id => "1" } @@ -54,10 +50,6 @@ module Api { :path => "/api/0.6/relation/1/relations", :method => :get }, { :controller => "api/relations", :action => "relations_for_relation", :id => "1" } ) - assert_routing( - { :path => "/api/0.6/node/1/relations.json", :method => :get }, - { :controller => "api/relations", :action => "relations_for_node", :id => "1", :format => "json" } - ) assert_routing( { :path => "/api/0.6/way/1/relations.json", :method => :get }, { :controller => "api/relations", :action => "relations_for_way", :id => "1", :format => "json" } @@ -228,32 +220,6 @@ module Api assert_equal node.id, js_nodes[0]["id"] end - ## - # check that all relations containing a particular node, and no extra - # relations, are returned from the relations_for_node call. - def test_relations_for_node - node = create(:node) - # should include relations with that node as a member - relation_with_node = create(:relation_member, :member => node).relation - # should ignore relations without that node as a member - _relation_without_node = create(:relation_member).relation - # should ignore relations with the node involved indirectly, via a way - way = create(:way_node, :node => node).way - _relation_with_way = create(:relation_member, :member => way).relation - # should ignore relations with the node involved indirectly, via a relation - second_relation = create(:relation_member, :member => node).relation - _super_relation = create(:relation_member, :member => second_relation).relation - # should combine multiple relation_member references into just one relation entry - create(:relation_member, :member => node, :relation => relation_with_node) - # should not include deleted relations - deleted_relation = create(:relation, :deleted) - create(:relation_member, :member => node, :relation => deleted_relation) - - check_relations_for_element(node_relations_path(node), "node", - node.id, - [relation_with_node, second_relation]) - end - def test_relations_for_way way = create(:way) # should include relations with that way as a member