get :read, :id => changeset_id
assert_response :success, "cannot get first changeset"
- assert_select "osm[version=#{API_VERSION}][generator=\"OpenStreetMap server\"]", 1
- assert_select "osm>changeset[id=#{changeset_id}]", 1
+ assert_select "osm[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
+ assert_select "osm>changeset[id='#{changeset_id}']", 1
assert_select "osm>changeset>discussion", 0
get :read, :id => changeset_id, :include_discussion => true
assert_response :success, "cannot get first changeset with comments"
- assert_select "osm[version=#{API_VERSION}][generator=\"OpenStreetMap server\"]", 1
- assert_select "osm>changeset[id=#{changeset_id}]", 1
+ assert_select "osm[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
+ assert_select "osm>changeset[id='#{changeset_id}']", 1
assert_select "osm>changeset>discussion", 1
end
"can't upload a simple valid creation to changeset: #{@response.body}"
# check the returned payload
- assert_select "diffResult[version=#{API_VERSION}][generator=\"OpenStreetMap server\"]", 1
+ assert_select "diffResult[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
assert_select "diffResult>node", 1
- assert_select "diffresult>way", 1
+ assert_select "diffResult>way", 1
assert_select "diffResult>relation", 1
# inspect the response to find out what the new element IDs are
"can't do a conditional delete of in use objects: #{@response.body}"
# check the returned payload
- assert_select "diffResult[version=#{API_VERSION}][generator=\"OpenStreetMap server\"]", 1
+ assert_select "diffResult[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
assert_select "diffResult>node", 1
- assert_select "diffresult>way", 1
+ assert_select "diffResult>way", 1
assert_select "diffResult>relation", 1
# parse the response
"can't upload a complex diff to changeset: #{@response.body}"
# check the returned payload
- assert_select "diffResult[version=#{API_VERSION}][generator=\"#{GENERATOR}\"]", 1
+ assert_select "diffResult[version='#{API_VERSION}'][generator='#{GENERATOR}']", 1
assert_select "diffResult>node", 1
assert_select "diffResult>way", 1
assert_select "diffResult>relation", 1
# check the response is well-formed
assert_select "diffResult>node", 3
- assert_select "diffResult>node[old_id=-1]", 3
+ assert_select "diffResult>node[old_id='-1']", 3
end
##
"failed to return error in XML format"
# check the returned payload
- assert_select "osmError[version=#{API_VERSION}][generator=\"OpenStreetMap server\"]", 1
+ assert_select "osmError[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
assert_select "osmError>status", 1
assert_select "osmError>message", 1
# FIXME needs more assert_select tests
assert_select "osmChange[version='#{API_VERSION}'][generator='#{GENERATOR}']" do
assert_select "create", :count => 5
- assert_select "create>node[id=#{nodes(:used_node_2).node_id}][visible=#{nodes(:used_node_2).visible?}][version=#{nodes(:used_node_2).version}]" do
- assert_select "tag[k=#{node_tags(:t3).k}][v=#{node_tags(:t3).v}]"
+ assert_select "create>node[id='#{nodes(:used_node_2).node_id}'][visible='#{nodes(:used_node_2).visible?}'][version='#{nodes(:used_node_2).version}']" do
+ assert_select "tag[k='#{node_tags(:t3).k}'][v='#{node_tags(:t3).v}']"
end
- assert_select "create>node[id=#{nodes(:visible_node).node_id}]"
+ assert_select "create>node[id='#{nodes(:visible_node).node_id}']"
end
end
# get the bounding box back from the changeset
get :read, :id => changeset_id
assert_response :success, "Couldn't read back changeset."
- assert_select "osm>changeset[min_lon=1.0]", 1
- assert_select "osm>changeset[max_lon=1.0]", 1
- assert_select "osm>changeset[min_lat=2.0]", 1
- assert_select "osm>changeset[max_lat=2.0]", 1
+ assert_select "osm>changeset[min_lon='1.0']", 1
+ assert_select "osm>changeset[max_lon='1.0']", 1
+ assert_select "osm>changeset[min_lat='2.0']", 1
+ assert_select "osm>changeset[max_lat='2.0']", 1
# add another node to it
with_controller(NodeController.new) do
# get the bounding box back from the changeset
get :read, :id => changeset_id
assert_response :success, "Couldn't read back changeset for the second time."
- assert_select "osm>changeset[min_lon=1.0]", 1
- assert_select "osm>changeset[max_lon=2.0]", 1
- assert_select "osm>changeset[min_lat=1.0]", 1
- assert_select "osm>changeset[max_lat=2.0]", 1
+ assert_select "osm>changeset[min_lon='1.0']", 1
+ assert_select "osm>changeset[max_lon='2.0']", 1
+ assert_select "osm>changeset[min_lat='1.0']", 1
+ assert_select "osm>changeset[max_lat='2.0']", 1
# add (delete) a way to it, which contains a point at (3,3)
with_controller(WayController.new) do
get :read, :id => changeset_id
assert_response :success, "Couldn't read back changeset for the third time."
# note that the 3.1 here is because of the bbox overexpansion
- assert_select "osm>changeset[min_lon=1.0]", 1
- assert_select "osm>changeset[max_lon=3.1]", 1
- assert_select "osm>changeset[min_lat=1.0]", 1
- assert_select "osm>changeset[max_lat=3.1]", 1
+ assert_select "osm>changeset[min_lon='1.0']", 1
+ assert_select "osm>changeset[max_lon='3.1']", 1
+ assert_select "osm>changeset[min_lat='1.0']", 1
+ assert_select "osm>changeset[max_lat='3.1']", 1
end
##
put :update, :id => changeset.id
assert_response :success
- assert_select "osm>changeset[id=#{changeset.id}]", 1
+ assert_select "osm>changeset[id='#{changeset.id}']", 1
assert_select "osm>changeset>tag", 2
- assert_select "osm>changeset>tag[k=tagtesting][v=valuetesting]", 1
+ assert_select "osm>changeset>tag[k='tagtesting'][v='valuetesting']", 1
end
##
assert_select "osmChange", 1
# this changeset contains node 17 in versions 1 & 2, but 1 should
# be hidden.
- assert_select "osmChange node[id=17]", 1
- assert_select "osmChange node[id=17][version=1]", 0
+ assert_select "osmChange node[id='17']", 1
+ assert_select "osmChange node[id='17'][version='1']", 0
end
##
def assert_changesets(ids)
assert_select "osm>changeset", ids.size
ids.each do |id|
- assert_select "osm>changeset[id=#{id}]", 1
+ assert_select "osm>changeset[id='#{id}']", 1
end
end
# check exactly one changeset
assert_select "osm>changeset", 1
- assert_select "osm>changeset[id=#{changeset_id}]", 1
+ assert_select "osm>changeset[id='#{changeset_id}']", 1
# check the bbox
doc = XML::Parser.string(@response.body).parse