Fix failing test case.
authorMatt Amos <zerebubuth@gmail.com>
Thu, 30 Apr 2009 17:37:18 +0000 (17:37 +0000)
committerMatt Amos <zerebubuth@gmail.com>
Thu, 30 Apr 2009 17:37:18 +0000 (17:37 +0000)
test/functional/changeset_controller_test.rb

index df18256e69e88aa2196bb142dff551303e1c9609..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_visible_relation).to_xml_node
-    delete << current_relations(:public_used_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}"