changeset_id = changesets(:public_user_first_change).id
%w(node way relation).each do |type|
delete.find("//osmChange/delete/#{type}").each do |n|
changeset_id = changesets(:public_user_first_change).id
%w(node way relation).each do |type|
delete.find("//osmChange/delete/#{type}").each do |n|
assert_equal 2, Node.find(new_node_id).tags.size, "new node should have two tags"
assert_equal [new_node_id, 3], Way.find(1).nds, "way nodes should match"
Relation.find(1).members.each do |type, id, _role|
assert_equal 2, Node.find(new_node_id).tags.size, "new node should have two tags"
assert_equal [new_node_id, 3], Way.find(1).nds, "way nodes should match"
Relation.find(1).members.each do |type, id, _role|
# check that objects are unmodified
assert_nodes_are_equal(node, Node.find(1))
assert_ways_are_equal(way, Way.find(1))
# check that objects are unmodified
assert_nodes_are_equal(node, Node.find(1))
assert_ways_are_equal(way, Way.find(1))
assert_response :success, "can't get changesets by time-since"
assert_changesets [1, 2, 4, 5, 6]
assert_response :success, "can't get changesets by time-since"
assert_changesets [1, 2, 4, 5, 6]
assert_response :success, "can't get changesets by time-since with hour"
assert_changesets [1, 2, 4, 5, 6]
assert_response :success, "can't get changesets by time-since with hour"
assert_changesets [1, 2, 4, 5, 6]
assert_response :success, "can't get changesets by time-range"
assert_changesets [1, 5, 6]
assert_response :success, "can't get changesets by time-range"
assert_changesets [1, 5, 6]
assert_response :success, "can't get changesets by open-ness"
assert_changesets [1, 2, 4]
assert_response :success, "can't get changesets by open-ness"
assert_changesets [1, 2, 4]
assert_response :success, "can't get changesets by closed-ness"
assert_changesets [3, 5, 6, 7, 8]
assert_response :success, "can't get changesets by closed-ness"
assert_changesets [3, 5, 6, 7, 8]
assert_response :success, "can't get changesets by closed-ness and user"
assert_changesets [3, 6, 8]
assert_response :success, "can't get changesets by closed-ness and user"
assert_changesets [3, 6, 8]
- get :query, :changesets => '1,2,3'
+ get :query, :changesets => "1,2,3"
assert_response :success, "can't get changesets by id (as comma-separated string)"
assert_changesets [1, 2, 3]
assert_response :success, "can't get changesets by id (as comma-separated string)"
assert_changesets [1, 2, 3]
changeset = changesets(:normal_user_first_change)
new_changeset = changeset.to_xml
new_tag = XML::Node.new "tag"
changeset = changesets(:normal_user_first_change)
new_changeset = changeset.to_xml
new_tag = XML::Node.new "tag"
changeset = changesets(:public_user_first_change)
new_changeset = changeset.to_xml
new_tag = XML::Node.new "tag"
changeset = changesets(:public_user_first_change)
new_changeset = changeset.to_xml
new_tag = XML::Node.new "tag"
changeset = changesets(:normal_user_first_change)
new_changeset = changeset.to_xml
new_tag = XML::Node.new "tag"
changeset = changesets(:normal_user_first_change)
new_changeset = changeset.to_xml
new_tag = XML::Node.new "tag"
- node_xml['lat'] = rand.to_s
- node_xml['lon'] = rand.to_s
- node_xml['version'] = (i + 1).to_s
+ node_xml["lat"] = rand.to_s
+ node_xml["lon"] = rand.to_s
+ node_xml["version"] = (i + 1).to_s
- node_xml['lat'] = rand.to_s
- node_xml['lon'] = rand.to_s
- node_xml['version'] = offset.to_s
+ node_xml["lat"] = rand.to_s
+ node_xml["lon"] = rand.to_s
+ node_xml["version"] = offset.to_s
assert_template :layout => "map"
assert_select "h2", :text => "Changesets", :count => 1
assert_template :layout => "map"
assert_select "h2", :text => "Changesets", :count => 1
- get :list, :format => "html", :list => '1', :bbox => '-180,-90,90,180'
+ get :list, :format => "html", :list => "1", :bbox => "-180,-90,90,180"
assert_template :layout => "xhr"
assert_select "h2", :text => "Changesets", :count => 1
assert_template :layout => "xhr"
assert_select "h2", :text => "Changesets", :count => 1
- get :list, :format => "html", :list => '1', :bbox => '-180,-90,90,180'
+ get :list, :format => "html", :list => "1", :bbox => "-180,-90,90,180"
def test_list_user_not_found
get :list, :format => "html", :display_name => "Some random user"
assert_response :not_found
def test_list_user_not_found
get :list, :format => "html", :display_name => "Some random user"
assert_response :not_found
- assert_difference('ChangesetComment.count') do
- post :comment, :id => changesets(:normal_user_closed_change).id, :text => 'This is a comment'
+ assert_difference("ChangesetComment.count") do
+ post :comment, :id => changesets(:normal_user_closed_change).id, :text => "This is a comment"
- assert_no_difference('ChangesetComment.count') do
- post :comment, :id => 999111, :text => 'This is a comment'
+ assert_no_difference("ChangesetComment.count") do
+ post :comment, :id => 999111, :text => "This is a comment"
- assert_no_difference('ChangesetComment.count') do
- post :comment, :id => changesets(:normal_user_first_change).id, :text => 'This is a comment'
+ assert_no_difference("ChangesetComment.count") do
+ post :comment, :id => changesets(:normal_user_first_change).id, :text => "This is a comment"
post :comment, :id => changesets(:normal_user_closed_change).id
end
assert_response :bad_request
# empty text
post :comment, :id => changesets(:normal_user_closed_change).id
end
assert_response :bad_request
# empty text
- assert_no_difference('ChangesetComment.count') do
- post :comment, :id => changesets(:normal_user_closed_change).id, :text => ''
+ assert_no_difference("ChangesetComment.count") do
+ post :comment, :id => changesets(:normal_user_closed_change).id, :text => ""
post :subscribe, :id => changeset.id
end
assert_response :unauthorized
post :subscribe, :id => changeset.id
end
assert_response :unauthorized
post :subscribe, :id => 999111
end
assert_response :not_found
# not closed changeset
changeset = changesets(:normal_user_first_change)
post :subscribe, :id => 999111
end
assert_response :not_found
# not closed changeset
changeset = changesets(:normal_user_first_change)
post :subscribe, :id => changeset.id
end
assert_response :conflict
# trying to subscribe when already subscribed
changeset = changesets(:normal_user_subscribed_change)
post :subscribe, :id => changeset.id
end
assert_response :conflict
# trying to subscribe when already subscribed
changeset = changesets(:normal_user_subscribed_change)
post :subscribe, :id => changeset.id
end
assert_response :conflict
post :subscribe, :id => changeset.id
end
assert_response :conflict
post :unsubscribe, :id => changeset.id
end
assert_response :unauthorized
post :unsubscribe, :id => changeset.id
end
assert_response :unauthorized
post :unsubscribe, :id => 999111
end
assert_response :not_found
# not closed changeset
changeset = changesets(:normal_user_first_change)
post :unsubscribe, :id => 999111
end
assert_response :not_found
# not closed changeset
changeset = changesets(:normal_user_first_change)
post :unsubscribe, :id => changeset.id
end
assert_response :conflict
# trying to unsubscribe when not subscribed
changeset = changesets(:normal_user_closed_change)
post :unsubscribe, :id => changeset.id
end
assert_response :conflict
# trying to unsubscribe when not subscribed
changeset = changesets(:normal_user_closed_change)
post :unsubscribe, :id => changeset.id
end
assert_response :not_found
post :unsubscribe, :id => changeset.id
end
assert_response :not_found
post :hide_comment, :id => comment.id
assert_response :unauthorized
end
post :hide_comment, :id => comment.id
assert_response :unauthorized
end
post :hide_comment, :id => comment.id
assert_response :forbidden
end
post :hide_comment, :id => comment.id
assert_response :forbidden
end
post :unhide_comment, :id => comment.id
assert_response :unauthorized
end
post :unhide_comment, :id => comment.id
assert_response :unauthorized
end
post :unhide_comment, :id => comment.id
assert_response :forbidden
end
post :unhide_comment, :id => comment.id
assert_response :forbidden
end
- assert_equal bbox[0], changeset['min_lon'].to_f, "min lon"
- assert_equal bbox[1], changeset['min_lat'].to_f, "min lat"
- assert_equal bbox[2], changeset['max_lon'].to_f, "max lon"
- assert_equal bbox[3], changeset['max_lat'].to_f, "max lat"
+ assert_equal bbox[0], changeset["min_lon"].to_f, "min lon"
+ assert_equal bbox[1], changeset["min_lat"].to_f, "min lat"
+ assert_equal bbox[2], changeset["max_lon"].to_f, "max lon"
+ assert_equal bbox[3], changeset["max_lat"].to_f, "max lat"
end
##
# update the changeset_id of a way element
def update_changeset(xml, changeset_id)
end
##
# update the changeset_id of a way element
def update_changeset(xml, changeset_id)