about summary refs log tree commit diff
path: root/spec/models/concerns
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2021-10-18 19:02:35 +0900
committerGitHub <noreply@github.com>2021-10-18 12:02:35 +0200
commit17f4e457b3a909522a230fd1f1f8f737e3faad87 (patch)
treea43668d4509e3e0ba9d0b0e17ea548a3901eb07e /spec/models/concerns
parent766a361b86f8c8212c08d3bae1d4728c3c5b1f09 (diff)
Add remove from followers api (#16864)
* Add followed_by? to account_interactions

* Add RemoveFromFollowersService

* Fix AccountBatch to use RemoveFromFollowersService

* Add remove from followers API
Diffstat (limited to 'spec/models/concerns')
-rw-r--r--spec/models/concerns/account_interactions_spec.rb17
1 files changed, 17 insertions, 0 deletions
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) }