Fix edits with no actual changes being allowed (#17843)
* Fix edits with no actual changes being allowed locally * Fix edits with no actual changes being allowed through ActivityPub * Fix false positive changes caused by description processing in model * Fix not recording poll expiration update * Fix test * Revert changes to ProcessStatusUpdateService * Various fixes and improvements * Fix code style issues * Various changes and improvements * Add guard clause
This commit is contained in:
parent
e3a2203061
commit
71f2b95106
9 changed files with 121 additions and 52 deletions
|
@ -3,6 +3,23 @@ require 'rails_helper'
|
|||
RSpec.describe UpdateStatusService, type: :service do
|
||||
subject { described_class.new }
|
||||
|
||||
context 'when nothing changes' do
|
||||
let!(:status) { Fabricate(:status, text: 'Foo', language: 'en') }
|
||||
|
||||
before do
|
||||
allow(ActivityPub::DistributionWorker).to receive(:perform_async)
|
||||
subject.call(status, status.account_id, text: 'Foo')
|
||||
end
|
||||
|
||||
it 'does not create an edit' do
|
||||
expect(status.reload.edits).to be_empty
|
||||
end
|
||||
|
||||
it 'does not notify anyone' do
|
||||
expect(ActivityPub::DistributionWorker).to_not have_received(:perform_async)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when text changes' do
|
||||
let!(:status) { Fabricate(:status, text: 'Foo') }
|
||||
let(:preview_card) { Fabricate(:preview_card) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue