mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 22:35:03 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user