@ -21,18 +21,27 @@ RSpec.describe AnnualReport::CommonlyInteractedWithAccounts do
let ( :account ) { Fabricate :account }
let ( :other_account ) { Fabricate :account }
let ( :most_other_account ) { Fabricate :account }
before do
_other = Fabricate :status
Fabricate :status , account : account , reply : true , in_reply_to_id : Fabricate ( :status , account : other_account ) . id
Fabricate :status , account : account , reply : true , in_reply_to_id : Fabricate ( :status , account : other_account ) . id
Fabricate :status , account : account , reply : true , in_reply_to_id : Fabricate ( :status , account : most_other_account ) . id
Fabricate :status , account : account , reply : true , in_reply_to_id : Fabricate ( :status , account : most_other_account ) . id
Fabricate :status , account : account , reply : true , in_reply_to_id : Fabricate ( :status , account : most_other_account ) . id
end
it 'builds a report for an account' do
expect ( subject . generate )
. to include (
commonly_interacted_with_accounts : contain_exactly (
include ( account_id : other_account . id . to_s , count : 2 )
commonly_interacted_with_accounts : eq (
[
{ account_id : most_other_account . id . to_s , count : 3 } ,
{ account_id : other_account . id . to_s , count : 2 } ,
]
)
)
end