bug(procedure.maj): impossible de mettre a jour une procedure avec une duree de conservation supérieur a 12 mois

This commit is contained in:
Martin 2023-03-10 10:16:36 +01:00
parent 6a2a7fa2d0
commit 4ac498392c

View file

@ -79,4 +79,22 @@ describe 'Administrateurs can edit procedures', js: true do
expect(procedure.reload.tags).to eq(['social'])
end
end
context 'when duree extension > 12' do
let!(:procedure) do
create(:procedure_with_dossiers,
:published,
:with_path,
:with_type_de_champ,
duree_conservation_dossiers_dans_ds: 24,
max_duree_conservation_dossiers_dans_ds: 24,
administrateur: administrateur)
end
scenario 'the administrator can edit and persist title' do
visit edit_admin_procedure_path(procedure)
fill_in('Titre de la démarche', with: 'Hello')
expect { click_on 'Enregistrer' }.to change { procedure.reload.libelle }
end
end
end