Fix Idempotency-Key ignored when scheduling a post (#30084)

This commit is contained in:
Claire 2024-04-26 15:19:02 +02:00 committed by GitHub
parent e845594878
commit 91ca90e25b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -54,6 +54,13 @@ RSpec.describe PostStatusService do
.to not_change { account.statuses_count }
.and(not_change { previous_status.replies_count })
end
it 'returns existing status when used twice with idempotency key' do
account = Fabricate(:account)
status1 = subject.call(account, text: 'test', idempotency: 'meepmeep', scheduled_at: future)
status2 = subject.call(account, text: 'test', idempotency: 'meepmeep', scheduled_at: future)
expect(status2.id).to eq status1.id
end
end
it 'creates response to the original status of boost' do