comments: change 'Show all comments' to 'Show N hidden comments'.

This commit is contained in:
evazion
2019-08-31 16:29:20 -05:00
parent be36968b6d
commit ee77b101af
2 changed files with 6 additions and 6 deletions

View File

@@ -35,18 +35,18 @@ class CommentsControllerTest < ActionDispatch::IntegrationTest
assert_select "#post_#{@post.id} #show-all-comments-link", 0
end
should "show the 'Show all comments' link on posts with thresholded comments" do
should "show the 'Show hidden comments' link on posts with thresholded comments" do
as(@user) { create(:comment, post: @post, score: -10) }
get comments_path(group_by: "post")
assert_response :success
assert_select "#post_#{@post.id}", 1
assert_select "#post_#{@post.id} #show-all-comments-link", 1
assert_select "#post_#{@post.id} #show-all-comments-link", /Show 1 hidden comment/
assert_select "#post_#{@post.id} .comment", 0
assert_select "#post_#{@post.id} .list-of-comments", /There are no visible comments/
end
should "not show the 'Show all comments' link on posts with deleted comments to Members" do
should "not show the 'Show hidden comments' link on posts with deleted comments to Members" do
@comment1 = as(@user) { create(:comment, post: @post) }
@comment2 = as(@user) { create(:comment, post: @post, is_deleted: true) }
get comments_path(group_by: "post")
@@ -57,7 +57,7 @@ class CommentsControllerTest < ActionDispatch::IntegrationTest
assert_select "#post_#{@post.id} #show-all-comments-link", 0
end
should "show the 'Show all comments' link on posts with deleted comments to Moderators" do
should "show the 'Show hidden comments' link on posts with deleted comments to Moderators" do
@comment1 = as(@user) { create(:comment, post: @post) }
@comment2 = as(@user) { create(:comment, post: @post, is_deleted: true) }
get_auth comments_path(group_by: "post"), @mod
@@ -65,7 +65,7 @@ class CommentsControllerTest < ActionDispatch::IntegrationTest
assert_response :success
assert_select "#post_#{@post.id}", 1
assert_select "#post_#{@post.id} .comment", 1
assert_select "#post_#{@post.id} #show-all-comments-link", 1
assert_select "#post_#{@post.id} #show-all-comments-link", /Show 1 hidden comment/
end
should "not bump posts with nonbumping comments" do