0
0
Fork 0

Revert friends-of-friends follow recommendation query to using a CTE (#29619)

This commit is contained in:
Claire 2024-03-18 13:57:21 +01:00 committed by GitHub
parent b5115850bb
commit d5063072c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 35 additions and 14 deletions

View file

@ -76,19 +76,19 @@ RSpec.describe AccountSuggestions::FriendsOfFriendsSource do
it 'contains correct underlying source data' do
expect(source_query_values)
.to contain_exactly(
[eugen.id, 2, 3], # Followed by 2 friends of bob (eve, mallory), 3 followers total (breaks tie)
[john.id, 2, 2], # Followed by 2 friends of bob (eve, mallory), 2 followers total
[neil.id, 1, 2], # Followed by 1 friends of bob (mallory), 2 followers total (breaks tie)
[jerk.id, 1, 1] # Followed by 1 friends of bob (eve), 1 followers total
[john.id, 2, 2], # Followed by 2 friends of bob (eve, mallory), 2 followers total (breaks tie)
[eugen.id, 2, 3], # Followed by 2 friends of bob (eve, mallory), 3 followers total
[jerk.id, 1, 1], # Followed by 1 friends of bob (eve), 1 followers total (breaks tie)
[neil.id, 1, 2] # Followed by 1 friends of bob (mallory), 2 followers total
)
end
def expected_results
[
[eugen.id, :friends_of_friends],
[john.id, :friends_of_friends],
[neil.id, :friends_of_friends],
[eugen.id, :friends_of_friends],
[jerk.id, :friends_of_friends],
[neil.id, :friends_of_friends],
]
end