1
0
Fork 0
forked from gitea/nas

Add circle/mutuals test

This commit is contained in:
KMY 2023-09-11 17:08:12 +09:00
parent 4752c8f032
commit af44c20d50
2 changed files with 36 additions and 0 deletions

View file

@ -9,6 +9,8 @@ describe AccountInteractions do
let(:target_account) { Fabricate(:account, username: 'target') }
let(:target_account_id) { target_account.id }
let(:target_account_ids) { [target_account_id] }
let(:follower_account) { Fabricate(:account, username: 'follower') }
let(:followee_account) { Fabricate(:account, username: 'followee') }
describe '.following_map' do
subject { Account.following_map(target_account_ids, account_id) }
@ -711,4 +713,20 @@ describe AccountInteractions do
expect(account.lists_for_local_distribution.to_a).to contain_exactly(follower_list, self_list)
end
end
describe '#mutuals' do
subject { account.mutuals }
context 'when following target_account' do
it 'mutual one' do
account.follow!(target_account)
target_account.follow!(account)
follower_account.follow!(account)
account.follow!(followee_account)
expect(subject.count).to eq 1
expect(subject.first.id).to eq target_account.id
end
end
end
end