specs: minor cleanups

This commit is contained in:
Pierre de La Morinerie 2021-11-12 08:27:02 +01:00
parent 09ca70eef0
commit 8d89ae366b
4 changed files with 9 additions and 10 deletions

View file

@ -6,7 +6,7 @@ RSpec.describe APIEntreprise::Job, type: :job do
describe '#perform' do
let(:dossier) { create(:dossier, :with_entreprise) }
context 'when a un retryable error is raised' do
context 'when an un-retriable error is raised' do
let(:errors) { [:standard_error] }
it 'does not retry' do
@ -14,7 +14,7 @@ RSpec.describe APIEntreprise::Job, type: :job do
end
end
context 'when a retryable error is raised' do
context 'when a retriable error is raised' do
let(:errors) { [:service_unavaible, :bad_gateway, :timed_out] }
it 'retries 5 times' do

View file

@ -1,4 +1,3 @@
describe Champs::IbanChamp do
describe '#valid?' do
it do

View file

@ -262,14 +262,14 @@ describe Instructeur, type: :model do
end
describe '#notifications_for_groupe_instructeurs' do
# one procedure, one group, 2 instructeurs
# a procedure, one group, 2 instructeurs
let(:procedure) { create(:simple_procedure, :routee, :with_type_de_champ_private, :for_individual) }
let(:gi_p1) { procedure.groupe_instructeurs.last }
let!(:dossier) { create(:dossier, :with_individual, :followed, groupe_instructeur: gi_p1, state: Dossier.states.fetch(:en_construction)) }
let!(:dossier) { create(:dossier, :with_individual, :followed, procedure: procedure, groupe_instructeur: gi_p1, state: Dossier.states.fetch(:en_construction)) }
let(:instructeur) { dossier.follows.first.instructeur }
let!(:instructeur_2) { create(:instructeur, groupe_instructeurs: [gi_p1]) }
# one other procedure, dossier followed by a third instructeur
# another procedure, dossier followed by a third instructeur
let!(:dossier_on_procedure_2) { create(:dossier, :followed, state: Dossier.states.fetch(:en_construction)) }
let!(:instructeur_on_procedure_2) { dossier_on_procedure_2.follows.first.instructeur }
let(:gi_p2) { dossier.groupe_instructeur }

View file

@ -16,7 +16,7 @@ describe ProcedurePresentation do
context 'for a published procedure' do
let(:procedure) { create(:procedure, :published) }
let!(:tdc) { { type_champ: :number, libelle: 'libelle 1' } }
let(:tdc) { { type_champ: :number, libelle: 'libelle 1' } }
before do
procedure.draft_revision.add_type_de_champ(tdc)
@ -26,7 +26,7 @@ describe ProcedurePresentation do
it { is_expected.to match(['libelle 1']) }
context 'when there is another published revision with an added tdc' do
let!(:added_tdc) { { type_champ: :number, libelle: 'libelle 2' } }
let(:added_tdc) { { type_champ: :number, libelle: 'libelle 2' } }
before do
procedure.draft_revision.add_type_de_champ(added_tdc)
@ -37,7 +37,7 @@ describe ProcedurePresentation do
end
context 'add one tdc above the first one' do
let!(:tdc2) { { type_champ: :number, libelle: 'libelle 2' } }
let(:tdc2) { { type_champ: :number, libelle: 'libelle 2' } }
before do
created_tdc2 = procedure.draft_revision.add_type_de_champ(tdc2)
@ -47,7 +47,7 @@ describe ProcedurePresentation do
it { is_expected.to match(['libelle 2', 'libelle 1']) }
context 'and finaly, when this tdc is removed' do
context 'and finally, when this tdc is removed' do
let!(:previous_tdc2) { procedure.published_revision.types_de_champ.find_by(libelle: 'libelle 2') }
before do