Enable Rubocop RSpec/NotToNot (#23723)
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
@ -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' })
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user