do not run ApiEntreprise jobs on missing etablissements
This commit is contained in:
parent
dd43c46e5e
commit
245e9e59c7
2 changed files with 14 additions and 0 deletions
|
@ -18,4 +18,14 @@ RSpec.describe ApiEntreprise::AssociationJob, type: :job do
|
|||
subject
|
||||
expect(Etablissement.find(etablissement.id).association_rna).to eq('W595001988')
|
||||
end
|
||||
|
||||
context "when the etablissement has been deleted" do
|
||||
before do
|
||||
allow_any_instance_of(Etablissement).to receive(:find) { raise ActiveRecord::RecordNotFound }
|
||||
end
|
||||
|
||||
it "ignores the error" do
|
||||
expect { subject }.not_to raise_error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue