0
0
Fork 0

Fix follow suggestions potentially including silenced or blocked accounts (#29306)

This commit is contained in:
Claire 2024-03-04 07:35:20 +01:00 committed by GitHub
parent 68600893d2
commit ee8d0b9447
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 107 additions and 34 deletions

View file

@ -11,14 +11,16 @@ RSpec.describe AccountSuggestions::Source do
end
context 'with follows and follow requests' do
let!(:account_domain_blocked_account) { Fabricate(:account, domain: 'blocked.host') }
let!(:account) { Fabricate(:account) }
let!(:blocked_account) { Fabricate(:account) }
let!(:eligible_account) { Fabricate(:account) }
let!(:follow_recommendation_muted_account) { Fabricate(:account) }
let!(:follow_requested_account) { Fabricate(:account) }
let!(:following_account) { Fabricate(:account) }
let!(:moved_account) { Fabricate(:account, moved_to_account: Fabricate(:account)) }
let!(:account_domain_blocked_account) { Fabricate(:account, domain: 'blocked.host', discoverable: true) }
let!(:account) { Fabricate(:account, discoverable: true) }
let!(:blocked_account) { Fabricate(:account, discoverable: true) }
let!(:eligible_account) { Fabricate(:account, discoverable: true) }
let!(:follow_recommendation_muted_account) { Fabricate(:account, discoverable: true) }
let!(:follow_requested_account) { Fabricate(:account, discoverable: true) }
let!(:following_account) { Fabricate(:account, discoverable: true) }
let!(:moved_account) { Fabricate(:account, moved_to_account: Fabricate(:account), discoverable: true) }
let!(:silenced_account) { Fabricate(:account, silenced: true, discoverable: true) }
let!(:undiscoverable_account) { Fabricate(:account, discoverable: false) }
before do
Fabricate :account_domain_block, account: account, domain: account_domain_blocked_account.domain
@ -40,6 +42,8 @@ RSpec.describe AccountSuggestions::Source do
.and not_include(follow_requested_account)
.and not_include(following_account)
.and not_include(moved_account)
.and not_include(silenced_account)
.and not_include(undiscoverable_account)
end
end
end