basic_authorization users(:normal_user).email, "test"
# Create the first user's changeset
content "<osm><changeset>" +
basic_authorization users(:normal_user).email, "test"
# Create the first user's changeset
content "<osm><changeset>" +
put :create
assert_require_public_data
basic_authorization users(:public_user).email, "test"
# Create the first user's changeset
content "<osm><changeset>" +
put :create
assert_require_public_data
basic_authorization users(:public_user).email, "test"
# Create the first user's changeset
content "<osm><changeset>" +
assert_select "osm>changeset>discussion>comment", 0
changeset_id = changesets(:normal_user_closed_change).id
assert_select "osm>changeset>discussion>comment", 0
changeset_id = changesets(:normal_user_closed_change).id
get :read, :id => changeset_id, :include_discussion => true
assert_response :success, "cannot get closed changeset with comments"
get :read, :id => changeset_id, :include_discussion => true
assert_response :success, "cannot get closed changeset with comments"
basic_authorization users(:public_user).email, "test"
content "<osm><changeset>" +
basic_authorization users(:public_user).email, "test"
content "<osm><changeset>" +
diff.root = XML::Node.new "osmChange"
modify = XML::Node.new "modify"
xml_old_node = old_node.to_xml_node
diff.root = XML::Node.new "osmChange"
modify = XML::Node.new "modify"
xml_old_node = old_node.to_xml_node
basic_authorization users(:public_user).email, "test"
content "<osm><changeset>" +
basic_authorization users(:public_user).email, "test"
content "<osm><changeset>" +
["<osmChange/>",
"<osmChange></osmChange>",
"<osmChange><modify/></osmChange>",
["<osmChange/>",
"<osmChange></osmChange>",
"<osmChange><modify/></osmChange>",
get :query, :closed => "true"
assert_response :success, "can't get changesets by closed-ness"
get :query, :closed => "true"
assert_response :success, "can't get changesets by closed-ness"
- assert_changesets [3, 5, 6, 7, 8]
+ assert_changesets [3, 5, 6, 7, 8, 9]
get :query, :closed => "true", :user => users(:normal_user).id
assert_response :success, "can't get changesets by closed-ness and user"
get :query, :closed => "true", :user => users(:normal_user).id
assert_response :success, "can't get changesets by closed-ness and user"
get :query, :bbox => bbox
assert_response :bad_request, "'#{bbox}' isn't a bbox"
end
get :query, :bbox => bbox
assert_response :bad_request, "'#{bbox}' isn't a bbox"
end
get :query, :time => time
assert_response :bad_request, "'#{time}' isn't a valid time range"
end
get :query, :time => time
assert_response :bad_request, "'#{time}' isn't a valid time range"
end
assert_equal true, comment.visible
post :hide_comment, :id => comment.id
assert_equal true, comment.visible
post :hide_comment, :id => comment.id
assert_equal true, comment.visible
basic_authorization(users(:moderator_user).email, "test")
assert_equal true, comment.visible
basic_authorization(users(:moderator_user).email, "test")
assert_equal false, comment.visible
post :unhide_comment, :id => comment.id
assert_equal false, comment.visible
post :unhide_comment, :id => comment.id
assert_equal false, comment.visible
basic_authorization(users(:moderator_user).email, "test")
assert_equal false, comment.visible
basic_authorization(users(:moderator_user).email, "test")
get :comments_feed, :format => "rss"
assert_response :success
assert_equal "application/rss+xml", @response.content_type
get :comments_feed, :format => "rss"
assert_response :success
assert_equal "application/rss+xml", @response.content_type
# check the result of a list
def check_list_result(changesets)
changesets = changesets.where("num_changes > 0")
# check the result of a list
def check_list_result(changesets)
changesets = changesets.where("num_changes > 0")
assert changesets.size <= 20
assert_select "ol.changesets", :count => [changesets.size, 1].min do
assert changesets.size <= 20
assert_select "ol.changesets", :count => [changesets.size, 1].min do
# check the result of a feed
def check_feed_result(changesets)
changesets = changesets.where("num_changes > 0")
# check the result of a feed
def check_feed_result(changesets)
changesets = changesets.where("num_changes > 0")
assert changesets.size <= 20
assert_select "feed", :count => [changesets.size, 1].min do
assert changesets.size <= 20
assert_select "feed", :count => [changesets.size, 1].min do
- assert_select "entry", :count => changesets.size
+ assert_select "> title", :count => 1, :text => /^Changesets/
+ assert_select "> entry", :count => changesets.size