about summary refs log tree commit diff
path: root/spec/workers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-11-07 21:07:01 +0100
committerGitHub <noreply@github.com>2022-11-07 21:07:01 +0100
commitac219dd1f6d660d3728c5881c4eb3b672fea432e (patch)
treefd2f30f2cb28a964442cc7b10d8ad8729bd659d2 /spec/workers
parentc493c967d67058a305006a09de66a1e08d877680 (diff)
parent2bc22be66cf09ed19eb7fb23b08324882a73b2b9 (diff)
Merge pull request #1903 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/move_worker_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/workers/move_worker_spec.rb b/spec/workers/move_worker_spec.rb
index be02d3192..3ca6aaf4d 100644
--- a/spec/workers/move_worker_spec.rb
+++ b/spec/workers/move_worker_spec.rb
@@ -74,6 +74,18 @@ describe MoveWorker do
     end
   end
 
+  shared_examples 'followers count handling' do
+    it 'updates the source account followers count' do
+      subject.perform(source_account.id, target_account.id)
+      expect(source_account.reload.followers_count).to eq(source_account.passive_relationships.count)
+    end
+
+    it 'updates the target account followers count' do
+      subject.perform(source_account.id, target_account.id)
+      expect(target_account.reload.followers_count).to eq(target_account.passive_relationships.count)
+    end
+  end
+
   context 'both accounts are distant' do
     describe 'perform' do
       it 'calls UnfollowFollowWorker' do
@@ -83,6 +95,7 @@ describe MoveWorker do
 
       include_examples 'user note handling'
       include_examples 'block and mute handling'
+      include_examples 'followers count handling'
     end
   end
 
@@ -97,6 +110,7 @@ describe MoveWorker do
 
       include_examples 'user note handling'
       include_examples 'block and mute handling'
+      include_examples 'followers count handling'
     end
   end
 
@@ -112,6 +126,7 @@ describe MoveWorker do
 
       include_examples 'user note handling'
       include_examples 'block and mute handling'
+      include_examples 'followers count handling'
 
       it 'does not fail when a local user is already following both accounts' do
         double_follower = Fabricate(:account)