Cleanup the Relation.from_xml to come in line with the Way and Node versions. Includes tests. Bug fix for the previous tests.

This commit is contained in:
Shaun McDonald 2009-06-10 17:17:03 +00:00
parent 3b063cfa19
commit 37df03a043
5 changed files with 78 additions and 21 deletions

View file

@ -433,10 +433,10 @@ class RelationControllerTest < ActionController::TestCase
assert_response :bad_request
# try to delete without specifying a changeset
content "<osm><relation id='#{current_relations(:visible_relation).id}'/></osm>"
content "<osm><relation id='#{current_relations(:visible_relation).id}' version='#{current_relations(:visible_relation).version}' /></osm>"
delete :delete, :id => current_relations(:visible_relation).id
assert_response :bad_request
assert_match(/You are missing the required changeset in the relation/, @response.body)
assert_match(/Changeset id is missing/, @response.body)
# try to delete with an invalid (closed) changeset
content update_changeset(current_relations(:visible_relation).to_xml,