FIX: Improve top links section from user summary (#15675)

* Do not extract links for hotlinked images
* Include only links that have been clicked at least once in user
summary
This commit is contained in:
Bianca Nenciu
2022-01-24 02:33:23 +02:00
committed by GitHub
parent cd68279f5c
commit 48e5d1af03
4 changed files with 25 additions and 0 deletions

View File

@ -93,4 +93,11 @@ 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