bug(expert/avis#instruction): raise when instructeur was merged

This commit is contained in:
Martin 2022-05-17 15:17:19 +02:00 committed by mfo
parent c55eb84bfb
commit fbc4e1810b

View file

@ -104,6 +104,17 @@ describe Experts::AvisController, type: :controller do
expect(flash.alert).to eq("Vous navez pas accès à cet avis.") expect(flash.alert).to eq("Vous navez pas accès à cet avis.")
end end
end end
context 'with merged instructeur who was claimant' do
render_views
it 'does not raise' do
old_claimant = create(:instructeur)
avis_with_merged_instructeur = create(:avis, dossier: dossier, claimant: old_claimant, experts_procedure: experts_procedure)
instructeur.user.merge(old_claimant.user)
sign_in(avis_with_merged_instructeur.expert.user)
get :instruction, params: { id: avis_with_merged_instructeur.id, procedure_id: procedure.id }
expect(response).to have_http_status(200)
end
end
end end
describe '#messagerie' do describe '#messagerie' do