Fix #4931: Add popup voter list for comments.

Show the comment's upvote and downvote count when you hover over a
comment's score. For mods, show the list of voters as well.
This commit is contained in:
evazion
2021-11-24 22:13:32 -06:00
parent 594b46a85d
commit a45e6b5cfe
15 changed files with 159 additions and 9 deletions

View File

@@ -27,6 +27,11 @@ class CommentVotesControllerTest < ActionDispatch::IntegrationTest
assert_response :success
end
should "render for a tooltip" do
get comment_votes_path(comment_id: @comment.id, variant: "tooltip")
assert_response :success
end
should respond_to_search({}).with { [] }
end
@@ -35,6 +40,11 @@ class CommentVotesControllerTest < ActionDispatch::IntegrationTest
CurrentUser.user = create(:mod_user)
end
should "render for a tooltip" do
get comment_votes_path(comment_id: @comment.id, variant: "tooltip")
assert_response :success
end
should respond_to_search({}).with { [@unrelated_vote, @negative_vote, @vote] }
should respond_to_search(score: -1).with { @negative_vote }