Merge pull request #8754 from mfo/US/fix-duree-conservation-dans-ds
correctif(procedure.maj): quand la duree conservation dans ds est supérieur a 12, on ne pouvait plus mettre a jour la procedure
This commit is contained in:
commit
df05c4fbc5
2 changed files with 20 additions and 2 deletions
|
@ -24,8 +24,8 @@
|
|||
%p.notice
|
||||
= t(:notice, scope: [:administrateurs, :duree_conservation_dossiers_dans_ds])
|
||||
- if f.object.duree_conservation_dossiers_dans_ds.to_i < Procedure::NEW_MAX_DUREE_CONSERVATION
|
||||
= t(:new_duration_constraint, scope: [:administrateurs, :duree_conservation_dossiers_dans_ds], new_duration_in_month: Procedure::NEW_MAX_DUREE_CONSERVATION)
|
||||
= f.number_field :duree_conservation_dossiers_dans_ds, { class: 'form-control', placeholder: '6', required: true }.merge(f.object.duree_conservation_etendue_par_ds ? {} : { max: Procedure::NEW_MAX_DUREE_CONSERVATION })
|
||||
= t(:new_duration_constraint, scope: [:administrateurs, :duree_conservation_dossiers_dans_ds], new_duration_in_month: f.object.max_duree_conservation_dossiers_dans_ds)
|
||||
= f.number_field :duree_conservation_dossiers_dans_ds, { class: 'form-control', placeholder: '6', required: true, max: f.object.max_duree_conservation_dossiers_dans_ds }
|
||||
|
||||
- if @procedure.created_at.present?
|
||||
= f.label :lien_site_web do
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue