Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Add test for reblog race condition fix (mastodon#17732)
Browse files Browse the repository at this point in the history
Follow-up to mastodon#17693
  • Loading branch information
ClearlyClaire authored Mar 9, 2022
1 parent 63c9d2b commit 5ccd6cb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/services/reblog_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@
end
end

context 'when the reblogged status is discarded in the meantime' do
let(:status) { Fabricate(:status, account: alice, visibility: :public) }

before do
status.discard
end

it 'raises an exception' do
expect { subject.call(alice, status) }.to raise_error ActiveRecord::ActiveRecordError
end
end

context 'ActivityPub' do
let(:bob) { Fabricate(:account, username: 'bob', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox') }
let(:status) { Fabricate(:status, account: bob) }
Expand Down

0 comments on commit 5ccd6cb

Please sign in to comment.