mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Use before_action to protect hidden collections in following/followers lists (#35783)
This commit is contained in:
@@ -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!
|
||||
|
||||
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user