about summary refs log tree commit diff
path: root/spec/controllers/follower_accounts_controller_spec.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-06-23 10:46:24 +0200
committerClaire <claire.github-309c@sitedethib.com>2021-06-23 10:46:24 +0200
commit37fd9670a586af057d12c3f789c0701ae074314f (patch)
treecc979a0bc830a9cc0c4e0d8beb90c487578dd522 /spec/controllers/follower_accounts_controller_spec.rb
parenta434f370f38ac66e05000545e36d7c696f4962d0 (diff)
parent63b807cffcba0579efdf2f4ed4a2deb93af4850b (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'spec/controllers/follower_accounts_controller_spec.rb')
-rw-r--r--spec/controllers/follower_accounts_controller_spec.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/controllers/follower_accounts_controller_spec.rb b/spec/controllers/follower_accounts_controller_spec.rb
index f6d55f693..006274169 100644
--- a/spec/controllers/follower_accounts_controller_spec.rb
+++ b/spec/controllers/follower_accounts_controller_spec.rb
@@ -3,7 +3,7 @@ require 'rails_helper'
 describe FollowerAccountsController do
   render_views
 
-  let(:alice) { Fabricate(:account, username: 'alice') }
+  let(:alice) { Fabricate(:user).account }
   let(:follower0) { Fabricate(:account) }
   let(:follower1) { Fabricate(:account) }
 
@@ -101,6 +101,23 @@ describe FollowerAccountsController do
           expect(body['partOf']).to be_blank
         end
 
+        context 'when account hides their network' do
+          before do
+            alice.user.settings.hide_network = true
+          end
+
+          it 'returns followers count' do
+            expect(body['totalItems']).to eq 2
+          end
+
+          it 'does not return items' do
+            expect(body['items']).to be_blank
+            expect(body['orderedItems']).to be_blank
+            expect(body['first']).to be_blank
+            expect(body['last']).to be_blank
+          end
+        end
+
         context 'when account is permanently suspended' do
           before do
             alice.suspend!