+ post :upload, :id => changeset_id
+ assert_response :unauthorized,
+ "shouldnn't be able to upload a simple valid diff to changeset: #{@response.body}"
+
+
+
+ ## Now try with a private user
+ basic_authorization users(:normal_user).email, "test"
+ changeset_id = changesets(:normal_user_first_change).id
+
+ # simple diff to change a node, way and relation by removing
+ # their tags
+ diff = <<EOF
+<osmChange>
+ <modify>
+ <node id='1' lon='0' lat='0' changeset='#{changeset_id}' version='1'/>
+ <way id='1' changeset='#{changeset_id}' version='1'>
+ <nd ref='3'/>
+ </way>
+ </modify>
+ <modify>
+ <relation id='1' changeset='#{changeset_id}' version='1'>
+ <member type='way' role='some' ref='3'/>
+ <member type='node' role='some' ref='5'/>
+ <member type='relation' role='some' ref='3'/>
+ </relation>
+ </modify>
+</osmChange>
+EOF
+
+ # upload it
+ content diff
+ post :upload, :id => changeset_id
+ assert_response :forbidden,
+ "can't upload a simple valid diff to changeset: #{@response.body}"
+
+
+
+ ## Now try with the public user
+ basic_authorization users(:public_user).email, "test"
+ changeset_id = changesets(:public_user_first_change).id
+
+ # simple diff to change a node, way and relation by removing
+ # their tags
+ diff = <<EOF
+<osmChange>
+ <modify>
+ <node id='1' lon='0' lat='0' changeset='#{changeset_id}' version='1'/>
+ <way id='1' changeset='#{changeset_id}' version='1'>
+ <nd ref='3'/>
+ </way>
+ </modify>
+ <modify>
+ <relation id='1' changeset='#{changeset_id}' version='1'>
+ <member type='way' role='some' ref='3'/>
+ <member type='node' role='some' ref='5'/>
+ <member type='relation' role='some' ref='3'/>
+ </relation>
+ </modify>
+</osmChange>
+EOF
+
+ # upload it
+ content diff
+ post :upload, :id => changeset_id