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

@ -60,7 +60,7 @@ RSpec.describe ActivityPub::CollectionsController, type: :controller do
end
it 'does not include contents of private pinned status' do
expect(response.body).not_to include(private_pinned.text)
expect(response.body).to_not include(private_pinned.text)
end
context 'when account is permanently suspended' do
@ -115,7 +115,7 @@ RSpec.describe ActivityPub::CollectionsController, type: :controller do
end
it 'does not include contents of private pinned status' do
expect(response.body).not_to include(private_pinned.text)
expect(response.body).to_not include(private_pinned.text)
end
end

View file

@ -68,7 +68,7 @@ RSpec.describe ActivityPub::InboxesController, type: :controller do
let(:synchronization_collection) { 'https://example.com/followers2' }
it 'does not start a synchronization job' do
expect(ActivityPub::FollowersSynchronizationWorker).not_to have_received(:perform_async)
expect(ActivityPub::FollowersSynchronizationWorker).to_not have_received(:perform_async)
end
end
@ -76,13 +76,13 @@ RSpec.describe ActivityPub::InboxesController, type: :controller do
let(:synchronization_url) { 'https://example.org/followers' }
it 'does not start a synchronization job' do
expect(ActivityPub::FollowersSynchronizationWorker).not_to have_received(:perform_async)
expect(ActivityPub::FollowersSynchronizationWorker).to_not have_received(:perform_async)
end
end
context 'with matching digest' do
it 'does not start a synchronization job' do
expect(ActivityPub::FollowersSynchronizationWorker).not_to have_received(:perform_async)
expect(ActivityPub::FollowersSynchronizationWorker).to_not have_received(:perform_async)
end
end

View file

@ -26,7 +26,7 @@ RSpec.describe Admin::AccountModerationNotesController, type: :controller do
let(:params) { { account_moderation_note: { target_account_id: target_account.id, content: '' } } }
it 'falls to create a note' do
expect { subject }.not_to change { AccountModerationNote.count }
expect { subject }.to_not change { AccountModerationNote.count }
expect(subject).to render_template 'admin/accounts/show'
end
end

View file

@ -84,7 +84,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
it 'fails to memorialize account' do
is_expected.to have_http_status :forbidden
expect(account.reload).not_to be_memorial
expect(account.reload).to_not be_memorial
end
end
@ -106,7 +106,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
it 'fails to memorialize account' do
is_expected.to have_http_status :forbidden
expect(account.reload).not_to be_memorial
expect(account.reload).to_not be_memorial
end
end
@ -115,7 +115,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
it 'fails to memorialize account' do
is_expected.to have_http_status :forbidden
expect(account.reload).not_to be_memorial
expect(account.reload).to_not be_memorial
end
end
end
@ -133,7 +133,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
it 'succeeds in enabling account' do
is_expected.to redirect_to admin_account_path(account.id)
expect(user.reload).not_to be_disabled
expect(user.reload).to_not be_disabled
end
end
@ -183,7 +183,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
it 'fails to approve account' do
is_expected.to have_http_status :forbidden
expect(user.reload).not_to be_approved
expect(user.reload).to_not be_approved
end
end
end
@ -223,7 +223,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
it 'fails to reject account' do
is_expected.to have_http_status :forbidden
expect(user.reload).not_to be_approved
expect(user.reload).to_not be_approved
end
end
end

View file

@ -35,7 +35,7 @@ RSpec.describe Admin::ChangeEmailsController, type: :controller do
expect(user.email).to eq previous_email
expect(user.unconfirmed_email).to eq 'test@example.com'
expect(user.confirmation_token).not_to be_nil
expect(user.confirmation_token).to_not be_nil
expect(UserMailer).to have_received(:confirmation_instructions).with(user, user.confirmation_token, { to: 'test@example.com' })

View file

@ -55,7 +55,7 @@ RSpec.describe Admin::ConfirmationsController, type: :controller do
it 'does not resend confirmation mail' do
expect(subject).to redirect_to admin_accounts_path
expect(flash[:error]).to eq I18n.t('admin.accounts.resend_confirmation.already_confirmed')
expect(UserMailer).not_to have_received(:confirmation_instructions)
expect(UserMailer).to_not have_received(:confirmation_instructions)
end
end
end

View file

@ -54,7 +54,7 @@ RSpec.describe Admin::DomainBlocksController, type: :controller do
post :create, params: { domain_block: { domain: 'example.com', severity: 'silence' } }
expect(DomainBlockWorker).not_to have_received(:perform_async)
expect(DomainBlockWorker).to_not have_received(:perform_async)
expect(response).to render_template :new
end

View file

@ -34,7 +34,7 @@ describe Admin::ReportNotesController do
it 'creates a report note and does not resolve report' do
expect { subject }.to change { ReportNote.count }.by(1)
expect(report.reload).not_to be_action_taken
expect(report.reload).to_not be_action_taken
expect(subject).to redirect_to admin_report_path(report)
end
end
@ -49,7 +49,7 @@ describe Admin::ReportNotesController do
it 'creates a report note and unresolves report' do
expect { subject }.to change { ReportNote.count }.by(1)
expect(report.reload).not_to be_action_taken
expect(report.reload).to_not be_action_taken
expect(subject).to redirect_to admin_report_path(report)
end
end

View file

@ -38,7 +38,7 @@ RSpec.describe Settings::ProfilesController, type: :controller do
put :update, params: { account: { avatar: fixture_file_upload('avatar.gif', 'image/gif') } }
expect(response).to redirect_to(settings_profile_path)
expect(account.reload.avatar.instance.avatar_file_name).not_to be_nil
expect(account.reload.avatar.instance.avatar_file_name).to_not be_nil
expect(ActivityPub::UpdateDistributionWorker).to have_received(:perform_async).with(account.id)
end
end

View file

@ -27,7 +27,7 @@ describe WellKnown::NodeInfoController, type: :controller do
json = body_as_json
expect({ 'foo' => 0 }).not_to match_json_schema('nodeinfo_2.0')
expect({ 'foo' => 0 }).to_not match_json_schema('nodeinfo_2.0')
expect(json).to match_json_schema('nodeinfo_2.0')
expect(json[:version]).to eq '2.0'
expect(json[:usage]).to be_a Hash