votes: show votes when hovering over post score.
Make it so you can hover over a post's score to see the list of public upvotes. Also show the upvote count, the downvote count, and the upvote ratio.
This commit is contained in:
@@ -10,8 +10,8 @@ class PostVotesControllerTest < ActionDispatch::IntegrationTest
|
||||
context "index action" do
|
||||
setup do
|
||||
@user = create(:user, enable_private_favorites: true)
|
||||
create(:post_vote, user: @user, score: 1)
|
||||
create(:post_vote, user: @user, score: -1)
|
||||
@upvote = create(:post_vote, user: @user, score: 1)
|
||||
@downvote = create(:post_vote, user: @user, score: -1)
|
||||
end
|
||||
|
||||
should "render" do
|
||||
@@ -19,6 +19,16 @@ class PostVotesControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
should "render for a compact view" do
|
||||
get post_votes_path(variant: "compact")
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
should "render for a tooltip" do
|
||||
get post_votes_path(search: { post_id: @upvote.post_id }, variant: "tooltip")
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
context "as a user" do
|
||||
should "show the user all their own votes" do
|
||||
get_auth post_votes_path, @user
|
||||
|
||||
Reference in New Issue
Block a user