0
0
Fork 0

Refactor Status._insert_record slightly and tighten the test around reblogs of discarded statuses (#24516)

This commit is contained in:
Claire 2023-04-12 12:47:05 +02:00 committed by GitHub
parent cee357d538
commit f53d009778
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 23 deletions

View file

@ -38,7 +38,10 @@ RSpec.describe ReblogService, type: :service do
let(:status) { Fabricate(:status, account: alice, visibility: :public) }
before do
status.discard
# Update the in-database attribute without reflecting the change in
# the object. This cannot simulate all race conditions, but it is
# pretty close.
Status.where(id: status.id).update_all(deleted_at: Time.now.utc) # rubocop:disable Rails/SkipsModelValidations
end
it 'raises an exception' do