Merge commit '53c183f899b5382f1eebd72e34a090c30f8eba6a' into glitch-soc/merge-upstream

This commit is contained in:
Claire committed 2024-08-19 18:25:31 +02:00
commit 1760f84349
54 files changed
+1054 -447

No files matched your search

@@ -15,6 +15,7 @@ RSpec.describe AccountSuggestions::FriendsOfFriendsSource do
let!(:john) { Fabricate(:account, discoverable: true, hide_collections: false) }
let!(:jerk) { Fabricate(:account, discoverable: true, hide_collections: false) }
let!(:larry) { Fabricate(:account, discoverable: true, hide_collections: false) }
let!(:morty) { Fabricate(:account, discoverable: true, hide_collections: false, memorial: true) }
context 'with follows and blocks' do
before do
@@ -27,8 +28,8 @@ RSpec.describe AccountSuggestions::FriendsOfFriendsSource do
# alice follows eve and mallory
[john, mallory].each { |account| alice.follow!(account) }
# eugen follows eve, john, jerk, larry and neil
[eve, mallory, jerk, larry, neil].each { |account| eugen.follow!(account) }
# eugen follows eve, john, jerk, larry, neil and morty
[eve, mallory, jerk, larry, neil, morty].each { |account| eugen.follow!(account) }
end
it 'returns eligible accounts', :aggregate_failures do
@@ -51,6 +52,9 @@ RSpec.describe AccountSuggestions::FriendsOfFriendsSource do
# the suggestion for neil has already been rejected
expect(results).to_not include([neil.id, :friends_of_friends])
# morty is not included because his account is in memoriam
expect(results).to_not include([morty.id, :friends_of_friends])
end
end
@@ -21,6 +21,7 @@ RSpec.describe AccountSuggestions::Source do
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) }
let!(:memorial_account) { Fabricate(:account, memorial: true, discoverable: true) }
before do
Fabricate :account_domain_block, account: account, domain: account_domain_blocked_account.domain
@@ -44,6 +45,7 @@ RSpec.describe AccountSuggestions::Source do
.and not_include(moved_account)
.and not_include(silenced_account)
.and not_include(undiscoverable_account)
.and not_include(memorial_account)
end
end
end