2
0

Disallow making private posts quotable (#35780)

This commit is contained in:
Claire
2025-08-14 15:58:25 +02:00
committed by GitHub
parent b0ce1ce49d
commit a2cddb9eac
2 changed files with 34 additions and 0 deletions

View File

@@ -90,5 +90,31 @@ RSpec.describe 'Interaction policies', feature: :outgoing_quotes do
.to_not have_enqueued_sidekiq_job
end
end
context 'when trying to change the interaction policy of a private post' do
let(:status) { Fabricate(:status, account: user.account, visibility: :private) }
let(:params) { { quote_approval_policy: 'public' } }
it 'keeps the interaction policy, returns the status, and does not schedule distribution jobs' do
expect { subject }
.to_not(change { status.reload.quote_approval_policy }.from(0))
expect(response).to have_http_status(200)
expect(response.content_type)
.to start_with('application/json')
expect(response.parsed_body).to include(
'quote_approval' => match(
'automatic' => [],
'manual' => [],
'current_user' => 'automatic'
)
)
expect(DistributionWorker)
.to_not have_enqueued_sidekiq_job
expect(ActivityPub::StatusUpdateDistributionWorker)
.to_not have_enqueued_sidekiq_job
end
end
end
end