X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/b70da7b8ea15ab48bb2f34155567cea6dffc8fc9..e8af4b85bf001ade543d03a503c769055d42e6a2:/test/controllers/api/relations_controller_test.rb diff --git a/test/controllers/api/relations_controller_test.rb b/test/controllers/api/relations_controller_test.rb index 44c6cd4ee..7d011c17f 100644 --- a/test/controllers/api/relations_controller_test.rb +++ b/test/controllers/api/relations_controller_test.rb @@ -612,8 +612,7 @@ module Api # valid delete should return the new version number, which should # be greater than the old version number - assert @response.body.to_i > multi_tag_relation.version, - "delete request should return a new version number for relation" + assert_operator @response.body.to_i, :>, multi_tag_relation.version, "delete request should return a new version number for relation" # this won't work since the relation is already deleted xml = update_changeset(xml_for_relation(deleted_relation), changeset.id) @@ -915,7 +914,7 @@ module Api assert_response :success # count one osm element - assert_select "osm[version='#{Settings.api_version}'][generator='OpenStreetMap server']", 1 + assert_select "osm[version='#{Settings.api_version}'][generator='#{Settings.generator}']", 1 # we should have only the expected number of relations assert_select "osm>relation", expected_relations.size @@ -1009,7 +1008,7 @@ module Api ## # updates the relation (XML) +rel+ and # yields the new version of that relation into the block. - # the parsed XML doc is retured. + # the parsed XML doc is returned. def with_update(rel, headers) rel_id = rel.find("//osm/relation").first["id"].to_i put api_relation_path(:id => rel_id), :params => rel.to_s, :headers => headers @@ -1029,14 +1028,14 @@ module Api ## # updates the relation (XML) +rel+ via the diff-upload API and # yields the new version of that relation into the block. - # the parsed XML doc is retured. + # the parsed XML doc is returned. def with_update_diff(rel, headers) rel_id = rel.find("//osm/relation").first["id"].to_i cs_id = rel.find("//osm/relation").first["changeset"].to_i version = nil with_controller(Api::ChangesetsController.new) do - doc = OSM::API.new.get_xml_doc + doc = OSM::API.new.xml_doc change = XML::Node.new "osmChange" doc.root = change modify = XML::Node.new "modify"