+ # randomly move the node about
+ 20.times do
+ # move the node somewhere else
+ xml_node['lat'] = precision(rand * 180 - 90).to_s
+ xml_node['lon'] = precision(rand * 360 - 180).to_s
+ with_controller(NodeController.new) do
+ content xml_doc
+ put :update, :id => nodeid
+ assert_response :forbidden, "Should have rejected node update"
+ xml_node['version'] = @response.body.to_s
+ end
+ # save a version for later checking
+ versions[xml_node['version']] = xml_doc.to_s
+ end
+
+ # add a bunch of random tags
+ 30.times do
+ xml_tag = XML::Node.new("tag")
+ xml_tag['k'] = random_string
+ xml_tag['v'] = random_string
+ xml_node << xml_tag
+ with_controller(NodeController.new) do
+ content xml_doc
+ put :update, :id => nodeid
+ assert_response :forbidden,
+ "should have rejected node #{nodeid} (#{@response.body}) with forbidden"
+ xml_node['version'] = @response.body.to_s
+ end
+ # save a version for later checking
+ versions[xml_node['version']] = xml_doc.to_s
+ end
+
+ # probably should check that they didn't get written to the database
+
+
+ ## Now do it with the public user
+ basic_authorization(users(:public_user).email, "test")
+ changeset_id = changesets(:public_user_first_change).id
+
+ # setup a simple XML node
+ xml_doc = current_nodes(:node_with_versions).to_xml
+ xml_node = xml_doc.find("//osm/node").first
+ nodeid = current_nodes(:node_with_versions).id
+
+ # keep a hash of the versions => string, as we'll need something
+ # to test against later
+ versions = Hash.new
+
+ # save a version for later checking
+ versions[xml_node['version']] = xml_doc.to_s
+