# create an relation without members
xml = "<osm><relation changeset='#{private_changeset.id}'><tag k='test' v='yes' /></relation></osm>"
# create an relation without members
xml = "<osm><relation changeset='#{private_changeset.id}'><tag k='test' v='yes' /></relation></osm>"
# create an relation without members
xml = "<osm><relation changeset='#{changeset.id}'><tag k='test' v='yes' /></relation></osm>"
# create an relation without members
xml = "<osm><relation changeset='#{changeset.id}'><tag k='test' v='yes' /></relation></osm>"
relation = create(:relation)
create_list(:relation_tag, 4, :relation => relation)
relation = create(:relation)
create_list(:relation_tag, 4, :relation => relation)
relation = create(:relation)
create_list(:relation_tag, 4, :relation => relation)
relation = create(:relation)
create_list(:relation_tag, 4, :relation => relation)
with_relation(relation.id) do |rel|
update_changeset(rel, changeset.id)
put api_relation_path(other_relation), :params => rel.to_s, :headers => auth_header
with_relation(relation.id) do |rel|
update_changeset(rel, changeset.id)
put api_relation_path(other_relation), :params => rel.to_s, :headers => auth_header
# create a relation with non-existing node as member
xml = "<osm><relation changeset='#{changeset.id}'>" \
# create a relation with non-existing node as member
xml = "<osm><relation changeset='#{changeset.id}'>" \
assert_response :unauthorized
## Then try with the private user, to make sure that you get a forbidden
assert_response :unauthorized
## Then try with the private user, to make sure that you get a forbidden
# this shouldn't work, as we should need the payload...
delete api_relation_path(relation), :headers => auth_header
# this shouldn't work, as we should need the payload...
delete api_relation_path(relation), :headers => auth_header
# this shouldn't work, as we should need the payload...
delete api_relation_path(relation), :headers => auth_header
# this shouldn't work, as we should need the payload...
delete api_relation_path(relation), :headers => auth_header
way1 = create(:way_with_nodes, :nodes_count => 2)
way2 = create(:way_with_nodes, :nodes_count => 2)
way1 = create(:way_with_nodes, :nodes_count => 2)
way2 = create(:way_with_nodes, :nodes_count => 2)
put relation_create_path, :params => doc.to_s, :headers => auth_header
assert_response :forbidden
## Now try with the public user
put relation_create_path, :params => doc.to_s, :headers => auth_header
assert_response :forbidden
## Now try with the public user
put relation_create_path, :params => doc.to_s, :headers => auth_header
assert_response :success, "can't create a relation: #{@response.body}"
put relation_create_path, :params => doc.to_s, :headers => auth_header
assert_response :success, "can't create a relation: #{@response.body}"
put relation_create_path, :params => doc.to_s, :headers => auth_header
assert_response :success, "can't create a relation: #{@response.body}"
put relation_create_path, :params => doc.to_s, :headers => auth_header
assert_response :success, "can't create a relation: #{@response.body}"
# that the changeset bounding box is +bbox+.
def check_changeset_modify(bbox)
## First test with the private user to check that you get a forbidden
# that the changeset bounding box is +bbox+.
def check_changeset_modify(bbox)
## First test with the private user to check that you get a forbidden
# create a new changeset for this operation, so we are assured
# that the bounding box will be newly-generated.
# create a new changeset for this operation, so we are assured
# that the bounding box will be newly-generated.
# create a new changeset for this operation, so we are assured
# that the bounding box will be newly-generated.
# create a new changeset for this operation, so we are assured
# that the bounding box will be newly-generated.