FIX: Show links with 0 clicks in top links section (#16016)

This is useful to moderators to see if users post spam links.
This commit is contained in:
Bianca Nenciu 2022-02-21 22:15:38 +02:00 committed by GitHub
parent ae1d2d957f
commit 94883dd326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 8 deletions

View File

@ -40,7 +40,6 @@ class UserSummary
.merge(Topic.listable_topics.visible.secured(@guardian))
.where(user: @user)
.where(internal: false, reflection: false, quote: false)
.where('clicks > 0')
.order('clicks DESC, topic_links.created_at DESC')
.limit(MAX_SUMMARY_RESULTS)
end

View File

@ -93,11 +93,4 @@ describe UserSummary do
expect(summary.top_categories.first[:topic_count]).to eq(1)
expect(summary.top_categories.first[:post_count]).to eq(1)
end
it "does not include summaries with no clicks" do
post = Fabricate(:post, raw: "[example](https://example.com)")
TopicLink.extract_from(post)
summary = UserSummary.new(post.user, Guardian.new)
expect(summary.links.length).to eq(0)
end
end