+ def test_create_invalid_xml
+ # Initial setup
+ basic_authorization(users(:normal_user).email, "test")
+ # normal user has a changeset open, so we'll use that.
+ changeset = changesets(:normal_user_first_change)
+ lat = 3.434
+ lon = 3.23
+
+ # test that the upload is rejected when no lat is supplied
+ # create a minimal xml file
+ content("<osm><node lon='#{lon}' changeset='#{changeset.id}'/></osm>")
+ put :create
+ # hope for success
+ assert_response :bad_request, "node upload did not return bad_request status"
+ assert_equal 'Cannot parse valid node from xml string <node lon="3.23" changeset="1"/>. lat missing', @response.body
+
+ # test that the upload is rejected when no lon is supplied
+ # create a minimal xml file
+ content("<osm><node lat='#{lat}' changeset='#{changeset.id}'/></osm>")
+ put :create
+ # hope for success
+ assert_response :bad_request, "node upload did not return bad_request status"
+ assert_equal 'Cannot parse valid node from xml string <node lat="3.434" changeset="1"/>. lon missing', @response.body
+
+ end
+