Change public self-quotes of private posts to be disallowed (#35975)
This commit is contained in:
@@ -88,10 +88,10 @@ RSpec.describe StatusPolicy, type: :model do
|
||||
|
||||
context 'with the permission of quote?' do
|
||||
permissions :quote? do
|
||||
it 'grants access when direct and account is viewer' do
|
||||
it 'does not grant access when direct and account is viewer' do
|
||||
status.visibility = :direct
|
||||
|
||||
expect(subject).to permit(status.account, status)
|
||||
expect(subject).to_not permit(status.account, status)
|
||||
end
|
||||
|
||||
it 'does not grant access access when direct and viewer is mentioned but not explicitly allowed' do
|
||||
|
||||
@@ -305,6 +305,14 @@ RSpec.describe PostStatusService do
|
||||
.to enqueue_sidekiq_job(ActivityPub::QuoteRequestWorker)
|
||||
end
|
||||
|
||||
it 'correctly downgrades visibility for private self-quotes' do
|
||||
account = Fabricate(:account)
|
||||
quoted_status = Fabricate(:status, account: account, visibility: :private)
|
||||
|
||||
status = subject.call(account, text: 'test', quoted_status: quoted_status)
|
||||
expect(status).to be_private_visibility
|
||||
end
|
||||
|
||||
it 'returns existing status when used twice with idempotency key' do
|
||||
account = Fabricate(:account)
|
||||
status1 = subject.call(account, text: 'test', idempotency: 'meepmeep')
|
||||
|
||||
Reference in New Issue
Block a user