test: fix not_to raise_error(SpecificErrorClass) false positive risk
This commit is contained in:
parent
c38dac789d
commit
edb47d94f7
6 changed files with 7 additions and 7 deletions
|
@ -32,7 +32,7 @@ RSpec.describe Cron::WeeklyOverviewJob, type: :job do
|
|||
end
|
||||
|
||||
it { expect(InstructeurMailer).to have_received(:last_week_overview).with(instructeur) }
|
||||
it { expect { run_job }.not_to raise_error(NoMethodError) }
|
||||
it { expect { run_job }.not_to raise_error }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ describe ExportJob do
|
|||
let(:format) { :zip }
|
||||
|
||||
it 'does not try to identify file' do
|
||||
expect { subject }.not_to raise_error(ActiveStorage::FileNotFoundError)
|
||||
expect { subject }.not_to raise_error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -33,7 +33,7 @@ describe Recovery::AlignChampWithDossierRevision do
|
|||
|
||||
expect(fixer.logs.size).to eq(1)
|
||||
expect(fixer.logs.first.fetch(:status)).to eq(:updated)
|
||||
expect { DossierPreloader.load_one(bad_dossier) }.not_to raise_error(ArgumentError)
|
||||
expect { DossierPreloader.load_one(bad_dossier) }.not_to raise_error
|
||||
expect(bad_dossier.champs.size).to eq(2)
|
||||
expect(bad_dossier.champs_public.size).to eq(2)
|
||||
end
|
||||
|
@ -60,7 +60,7 @@ describe Recovery::AlignChampWithDossierRevision do
|
|||
|
||||
expect(fixer.logs.size).to eq(1)
|
||||
expect(fixer.logs.first.fetch(:status)).to eq(:not_found)
|
||||
expect { DossierPreloader.load_one(bad_dossier) }.not_to raise_error(ArgumentError)
|
||||
expect { DossierPreloader.load_one(bad_dossier) }.not_to raise_error
|
||||
expect(bad_dossier.champs.size).to eq(1)
|
||||
expect(bad_dossier.champs_public.size).to eq(1)
|
||||
end
|
||||
|
|
|
@ -30,7 +30,7 @@ describe 'Recovery::Revision::LifeCycle' do
|
|||
expect(dossier.champs_public.size).to eq(1)
|
||||
expect(dossier.champs.size).to eq(2)
|
||||
importer.load
|
||||
expect { DossierPreloader.load_one(dossier) }.not_to raise_error(ArgumentError)
|
||||
expect { DossierPreloader.load_one(dossier) }.not_to raise_error
|
||||
expect(dossier.champs_public.size).to eq(2)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -385,7 +385,7 @@ RSpec.describe DossierCloneConcern do
|
|||
procedure.publish_revision!
|
||||
end
|
||||
it 'works' do
|
||||
expect { subject }.not_to raise_error(ActiveRecord::InvalidForeignKey)
|
||||
expect { subject }.not_to raise_error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -489,7 +489,7 @@ describe ProcedureExportService do
|
|||
subject { service.to_zip }
|
||||
context 'without files' do
|
||||
it 'does not raises in_batches' do
|
||||
expect { subject }.not_to raise_error(NoMethodError)
|
||||
expect { subject }.not_to raise_error
|
||||
end
|
||||
|
||||
it 'returns an empty blob' do
|
||||
|
|
Loading…
Reference in a new issue