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"
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 "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_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