Refactor Status._insert_record
slightly and tighten the test around reblogs of discarded statuses (#24516)
This commit is contained in:
parent
cee357d538
commit
f53d009778
2 changed files with 34 additions and 23 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue