Use before_action to protect hidden collections in following/followers lists (#35783)

This commit is contained in:
Matt Jankowski
2025-10-30 12:34:19 -04:00
committed by GitHub
parent 13a070f8d1
commit aefd728309
4 changed files with 32 additions and 7 deletions

View File

@@ -57,6 +57,17 @@ RSpec.describe FollowerAccountsController do
)
end
context 'when account hides their network' do
before { alice.update(hide_collections: true) }
it 'returns forbidden response' do
expect(response)
.to have_http_status(403)
expect(response.parsed_body)
.to include(error: /forbidden/i)
end
end
context 'when account is permanently suspended' do
before do
alice.suspend!

View File

@@ -57,6 +57,17 @@ RSpec.describe FollowingAccountsController do
)
end
context 'when account hides their network' do
before { alice.update(hide_collections: true) }
it 'returns forbidden response' do
expect(response)
.to have_http_status(403)
expect(response.parsed_body)
.to include(error: /forbidden/i)
end
end
context 'when account is permanently suspended' do
before do
alice.suspend!