]> git.openstreetmap.org Git - rails.git/blobdiff - test/functional/changeset_controller_test.rb
One final (I've checked the rest now!) mis-referenced id, plus make the error msg...
[rails.git] / test / functional / changeset_controller_test.rb
index 1e20f640b84963d365bd217e2cea90223d199653..a6eeaeeebd7911f02ae1c383a2e355af91bbc671 100644 (file)
@@ -308,14 +308,22 @@ EOF
     diff.root = XML::Node.new "osmChange"
     delete = XML::Node.new "delete"
     diff.root << delete
-    delete << current_relations(:public_used_relation).to_xml_node
-    delete << current_relations(:public_visible_relation).to_xml_node
+    delete << current_relations(:visible_relation).to_xml_node
+    delete << current_relations(:used_relation).to_xml_node
     delete << current_ways(:used_way).to_xml_node
     delete << current_nodes(:node_used_by_relationship).to_xml_node
 
+    # update the changeset to one that this user owns
+    changeset_id = changesets(:public_user_first_change).id
+    ["node", "way", "relation"].each do |type|
+      delete.find("//osmChange/delete/#{type}").each do |n| 
+        n['changeset'] = changeset_id.to_s 
+      end
+    end
+
     # upload it
     content diff
-    post :upload, :id => changesets(:public_user_first_change).id
+    post :upload, :id => changeset_id
     assert_response :success, 
       "can't upload a deletion diff to changeset: #{@response.body}"