Fix #3351: Mod+: Treat deleted comments as below score threshold.

Comments have three states: visible, hidden, and invisible. Visible
comments are always shown. Hidden comments are not shown until the user
clicks 'Show all comments'. Invisible comments are never shown to the
user. Deleted comments are treated as hidden for moderators and
invisible for normal users. Thresholded comments are treated as hidden
for all users.
This commit is contained in:
evazion
2019-08-31 16:15:31 -05:00
parent 7e2eb7e5a7
commit be36968b6d
6 changed files with 99 additions and 27 deletions

View File

@@ -157,12 +157,14 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
assert_select "div.list-of-comments p", /There are no comments/
end
should "show deleted comments to moderators" do
should "not show deleted comments to moderators by default, but allow them to be unhidden" do
mod = create(:mod_user)
get_auth post_path(@post), mod, params: { id: @post.id }
assert_response :success
assert_select "article.comment", 1
assert_select "article.comment", 0
assert_select "a#show-all-comments-link", 1
assert_select "div.list-of-comments p", /There are no comments/
end
end