0
0
Fork 0

Enable Rubocop RSpec/NotToNot (#23723)

This commit is contained in:
Nick Schonning 2023-02-19 20:33:27 -05:00 committed by GitHub
parent a2fdb388eb
commit 65ba0d92ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 94 additions and 214 deletions

View file

@ -39,7 +39,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do
end
it 'does not process payload' do
expect(ActivityPub::Activity).not_to receive(:factory)
expect(ActivityPub::Activity).to_not receive(:factory)
subject.call(json, actor)
end
end
@ -69,7 +69,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do
it 'does not process payload if no signature exists' do
expect_any_instance_of(ActivityPub::LinkedDataSignature).to receive(:verify_actor!).and_return(nil)
expect(ActivityPub::Activity).not_to receive(:factory)
expect(ActivityPub::Activity).to_not receive(:factory)
subject.call(json, forwarder)
end
@ -87,7 +87,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do
payload['signature'] = { 'type' => 'RsaSignature2017' }
expect_any_instance_of(ActivityPub::LinkedDataSignature).to receive(:verify_actor!).and_return(nil)
expect(ActivityPub::Activity).not_to receive(:factory)
expect(ActivityPub::Activity).to_not receive(:factory)
subject.call(json, forwarder)
end
@ -206,7 +206,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do
end
it 'does not process forged payload' do
expect(ActivityPub::Activity).not_to receive(:factory).with(
expect(ActivityPub::Activity).to_not receive(:factory).with(
hash_including(
'object' => hash_including(
'id' => 'https://example.com/users/bob/fake-status'
@ -216,7 +216,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do
anything
)
expect(ActivityPub::Activity).not_to receive(:factory).with(
expect(ActivityPub::Activity).to_not receive(:factory).with(
hash_including(
'object' => hash_including(
'content' => '<p>puck was here</p>'

View file

@ -214,11 +214,11 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
end
it 'does not create any edits' do
expect { subject.call(status, json) }.not_to change { status.reload.edits.pluck(&:id) }
expect { subject.call(status, json) }.to_not change { status.reload.edits.pluck(&:id) }
end
it 'does not update the text, spoiler_text or edited_at' do
expect { subject.call(status, json) }.not_to change { s = status.reload; [s.text, s.spoiler_text, s.edited_at] }
expect { subject.call(status, json) }.to_not change { s = status.reload; [s.text, s.spoiler_text, s.edited_at] }
end
end