bug(root): test root

This commit is contained in:
Martin 2022-05-17 15:20:33 +02:00 committed by mfo
parent fbc4e1810b
commit d0599dd36b
2 changed files with 12 additions and 11 deletions

View file

@ -104,17 +104,6 @@ describe Experts::AvisController, type: :controller do
expect(flash.alert).to eq("Vous navez pas accès à cet avis.")
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
describe '#messagerie' do

View file

@ -828,6 +828,18 @@ describe Instructeur, type: :model do
expect(administrateur.reload.instructeurs).to match_array(new_instructeur)
end
end
context 'when old instructeur has avis' do
let(:avis) { create(:avis, claimant: old_instructeur) }
before do
avis
subject
end
it 'reassign avis to new_instructeur' do
avis.reload
expect(avis.claimant).to eq(new_instructeur)
end
end
end
private