Fix RSpec/ExpectChange cop (#25101)
This commit is contained in:
parent
1caa5ff39e
commit
d2e5430d4a
12 changed files with 24 additions and 41 deletions
|
@ -19,7 +19,7 @@ RSpec.describe Admin::AccountModerationNotesController do
|
|||
let(:params) { { account_moderation_note: { target_account_id: target_account.id, content: 'test content' } } }
|
||||
|
||||
it 'successfully creates a note' do
|
||||
expect { subject }.to change { AccountModerationNote.count }.by(1)
|
||||
expect { subject }.to change(AccountModerationNote, :count).by(1)
|
||||
expect(subject).to redirect_to admin_account_path(target_account.id)
|
||||
end
|
||||
end
|
||||
|
@ -28,7 +28,7 @@ RSpec.describe Admin::AccountModerationNotesController do
|
|||
let(:params) { { account_moderation_note: { target_account_id: target_account.id, content: '' } } }
|
||||
|
||||
it 'falls to create a note' do
|
||||
expect { subject }.to_not change { AccountModerationNote.count }
|
||||
expect { subject }.to_not change(AccountModerationNote, :count)
|
||||
expect(subject).to render_template 'admin/accounts/show'
|
||||
end
|
||||
end
|
||||
|
@ -41,7 +41,7 @@ RSpec.describe Admin::AccountModerationNotesController do
|
|||
let(:account) { Fabricate(:account) }
|
||||
|
||||
it 'destroys note' do
|
||||
expect { subject }.to change { AccountModerationNote.count }.by(-1)
|
||||
expect { subject }.to change(AccountModerationNote, :count).by(-1)
|
||||
expect(subject).to redirect_to admin_account_path(target_account.id)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue