]> git.openstreetmap.org Git - rails.git/blobdiff - test/functional/changeset_controller_test.rb
Adding some amf create poi tests. Minor bugfix tweaks to the amf controller
[rails.git] / test / functional / changeset_controller_test.rb
index 47cd95c241a9915dbf53df19546dfa3a73425c8d..e8648e5c3a8c9058c4db9fe10dd1e5f6d454e33f 100644 (file)
@@ -310,7 +310,7 @@ EOF
   </relation>
  </modify>
  <create>
-  <node id='-1' changeset='4'>
+  <node id='-1' lon='0' lat='0' changeset='4'>
    <tag k='foo' v='bar'/>
    <tag k='baz' v='bat'/>
   </node>
@@ -741,16 +741,25 @@ EOF
   ##
   # check updating tags on a changeset
   def test_changeset_update
-    basic_authorization "test@openstreetmap.org", "test"
-
     changeset = changesets(:normal_user_first_change)
     new_changeset = changeset.to_xml
     new_tag = XML::Node.new "tag"
     new_tag['k'] = "tagtesting"
     new_tag['v'] = "valuetesting"
     new_changeset.find("//osm/changeset").first << new_tag
-
     content new_changeset
+
+    # try without any authorization
+    put :update, :id => changeset.id
+    assert_response :unauthorized
+
+    # try with the wrong authorization
+    basic_authorization "test@example.com", "test"
+    put :update, :id => changeset.id
+    assert_response :conflict
+
+    # now this should work...
+    basic_authorization "test@openstreetmap.org", "test"
     put :update, :id => changeset.id
     assert_response :success
 
@@ -851,7 +860,7 @@ EOF
   # call the include method and assert properties of the bbox
   def check_after_include(changeset_id, lon, lat, bbox)
     content "<osm><node lon='#{lon}' lat='#{lat}'/></osm>"
-    post :include, :id => changeset_id
+    post :expand_bbox, :id => changeset_id
     assert_response :success, "Setting include of changeset failed: #{@response.body}"
 
     # check exactly one changeset