From 17f4e457b3a909522a230fd1f1f8f737e3faad87 Mon Sep 17 00:00:00 2001 From: Takeshi Umeda Date: Mon, 18 Oct 2021 19:02:35 +0900 Subject: Add remove from followers api (#16864) * Add followed_by? to account_interactions * Add RemoveFromFollowersService * Fix AccountBatch to use RemoveFromFollowersService * Add remove from followers API --- spec/models/concerns/account_interactions_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'spec/models/concerns') diff --git a/spec/models/concerns/account_interactions_spec.rb b/spec/models/concerns/account_interactions_spec.rb index ca243ebc5..0369aff10 100644 --- a/spec/models/concerns/account_interactions_spec.rb +++ b/spec/models/concerns/account_interactions_spec.rb @@ -360,6 +360,23 @@ describe AccountInteractions do end end + describe '#followed_by?' do + subject { account.followed_by?(target_account) } + + context 'followed by target_account' do + it 'returns true' do + account.passive_relationships.create(account: target_account) + is_expected.to be true + end + end + + context 'not followed by target_account' do + it 'returns false' do + is_expected.to be false + end + end + end + describe '#blocking?' do subject { account.blocking?(target_account) } -- cgit