votes: fixup various minor issues.
* Add a gap between thumbnails on mobile. * Adjust CSS for scores and vote buttons. * Include "Private favorites" as an incentive on the user upgrade page. * Fix vote buttons not being visible beneath thumbnails on mobile. * Fix the "Show scores" link not preserving the current page number. * Fix vote buttons being unintentionally enabled for all thumbnails by default. * Fix banned and restricted users being able to favorite posts by tagging them with `fav:self`. * Fix search engines being able to crawl /posts?view=score pages. * Fix broken tests.
This commit is contained in:
@@ -11,12 +11,12 @@ class PostVotesComponentTest < ViewComponent::TestCase
|
||||
end
|
||||
|
||||
context "for a user who can't vote" do
|
||||
should "not show the vote buttons" do
|
||||
should "show the vote buttons" do
|
||||
render_post_votes(@post, current_user: User.anonymous)
|
||||
|
||||
assert_css(".post-score")
|
||||
assert_no_css(".post-upvote-link")
|
||||
assert_no_css(".post-downvote-link")
|
||||
assert_css(".post-upvote-link.inactive-link")
|
||||
assert_css(".post-downvote-link.inactive-link")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,8 +34,8 @@ class PostVotesComponentTest < ViewComponent::TestCase
|
||||
|
||||
context "for a downvoted post" do
|
||||
should "highlight the downvote button as active" do
|
||||
@post.vote!(-1, @user)
|
||||
render_post_votes(@post, current_user: @user)
|
||||
create(:post_vote, post: @post, user: @user, score: -1)
|
||||
as(@user) { render_post_votes(@post, current_user: @user) }
|
||||
|
||||
assert_css(".post-upvote-link.inactive-link")
|
||||
assert_css(".post-downvote-link.active-link")
|
||||
@@ -44,8 +44,8 @@ class PostVotesComponentTest < ViewComponent::TestCase
|
||||
|
||||
context "for an upvoted post" do
|
||||
should "highlight the upvote button as active" do
|
||||
@post.vote!(1, @user)
|
||||
render_post_votes(@post, current_user: @user)
|
||||
create(:post_vote, post: @post, user: @user, score: 1)
|
||||
as(@user) { render_post_votes(@post, current_user: @user) }
|
||||
|
||||
assert_css(".post-upvote-link.active-link")
|
||||
assert_css(".post-downvote-link.inactive-link")
|
||||
|
||||
Reference in New Issue
Block a user