From d55f156aec63f39ebfb1907b7d2e7c69baeb2b2b Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Tue, 16 Feb 2021 17:56:21 +0100 Subject: [PATCH] =?UTF-8?q?admin:=20dur=C3=A9e=20de=20conservation=20des?= =?UTF-8?q?=20donn=C3=A9es=20hors=20ds=20n'est=20plus=20demand=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit La colonne est tout de même gardée en base --- app/models/procedure.rb | 2 +- .../new_administrateur/procedures/_informations.html.haml | 7 ------- spec/factories/procedure.rb | 1 - spec/features/admin/procedure_creation_spec.rb | 1 - spec/features/admin/procedure_spec_helper.rb | 1 - spec/models/procedure_spec.rb | 6 ------ 6 files changed, 1 insertion(+), 17 deletions(-) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 3a6c9e652..0689d8f95 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -188,7 +188,7 @@ class Procedure < ApplicationRecord validate :check_juridique validates :path, presence: true, format: { with: /\A[a-z0-9_\-]{3,200}\z/ }, uniqueness: { scope: [:path, :closed_at, :hidden_at, :unpublished_at], case_sensitive: false } validates :duree_conservation_dossiers_dans_ds, allow_nil: false, numericality: { only_integer: true, greater_than_or_equal_to: 1, less_than_or_equal_to: MAX_DUREE_CONSERVATION } - validates :duree_conservation_dossiers_hors_ds, allow_nil: false, numericality: { only_integer: true, greater_than_or_equal_to: 0 } + validates :duree_conservation_dossiers_hors_ds, allow_nil: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 } validates_with MonAvisEmbedValidator validates :notice, content_type: [ "application/msword", diff --git a/app/views/new_administrateur/procedures/_informations.html.haml b/app/views/new_administrateur/procedures/_informations.html.haml index 944a177ab..bb58d3cc8 100644 --- a/app/views/new_administrateur/procedures/_informations.html.haml +++ b/app/views/new_administrateur/procedures/_informations.html.haml @@ -24,13 +24,6 @@ %p.notice (durée en mois après le début de l’instruction) = f.number_field :duree_conservation_dossiers_dans_ds, class: 'form-control', placeholder: '6', required: true -- if !@procedure.locked? - = f.label :duree_conservation_dossiers_hors_ds do - Hors #{APPLICATION_NAME} - %span.mandatory * - %p.notice (durée en mois après la fin de l'instruction) - = f.number_field :duree_conservation_dossiers_hors_ds, class: 'form-control', placeholder: '6', required: true - - if @procedure.created_at.present? = f.label :lien_site_web do Où les usagers trouveront-ils le lien vers la démarche ? diff --git a/spec/factories/procedure.rb b/spec/factories/procedure.rb index f74e2da10..aff410e8d 100644 --- a/spec/factories/procedure.rb +++ b/spec/factories/procedure.rb @@ -8,7 +8,6 @@ FactoryBot.define do cadre_juridique { "un cadre juridique important" } published_at { nil } duree_conservation_dossiers_dans_ds { 3 } - duree_conservation_dossiers_hors_ds { 6 } ask_birthday { false } lien_site_web { "https://mon-site.gouv" } path { SecureRandom.uuid } diff --git a/spec/features/admin/procedure_creation_spec.rb b/spec/features/admin/procedure_creation_spec.rb index 17993f4de..5ef45a31b 100644 --- a/spec/features/admin/procedure_creation_spec.rb +++ b/spec/features/admin/procedure_creation_spec.rb @@ -38,7 +38,6 @@ feature 'As an administrateur I wanna create a new procedure', js: true do expect(find('#procedure_for_individual_true')).to be_checked expect(find('#procedure_for_individual_false')).not_to be_checked fill_in 'procedure_duree_conservation_dossiers_dans_ds', with: '3' - fill_in 'procedure_duree_conservation_dossiers_hors_ds', with: '6' click_on 'Créer la démarche' expect(page).to have_text('Libelle doit être rempli') diff --git a/spec/features/admin/procedure_spec_helper.rb b/spec/features/admin/procedure_spec_helper.rb index b9708d3a4..134e93ec9 100644 --- a/spec/features/admin/procedure_spec_helper.rb +++ b/spec/features/admin/procedure_spec_helper.rb @@ -4,6 +4,5 @@ module ProcedureSpecHelper fill_in 'procedure_description', with: 'description de la procedure' fill_in 'procedure_cadre_juridique', with: 'cadre juridique' fill_in 'procedure_duree_conservation_dossiers_dans_ds', with: '3' - fill_in 'procedure_duree_conservation_dossiers_hors_ds', with: '6' end end diff --git a/spec/models/procedure_spec.rb b/spec/models/procedure_spec.rb index 7df85ef04..7db2c00f7 100644 --- a/spec/models/procedure_spec.rb +++ b/spec/models/procedure_spec.rb @@ -271,12 +271,6 @@ describe Procedure do it_behaves_like 'duree de conservation' end - - describe 'duree de conservation hors ds' do - let(:field_name) { :duree_conservation_dossiers_hors_ds } - - it_behaves_like 'duree de conservation' - end end describe 'active' do