diff --git a/app/models/type_de_champ.rb b/app/models/type_de_champ.rb index afa6a821a..05091ec70 100644 --- a/app/models/type_de_champ.rb +++ b/app/models/type_de_champ.rb @@ -267,7 +267,8 @@ class TypeDeChamp < ApplicationRecord TypeDeChamp.type_champs.fetch(:yes_no), TypeDeChamp.type_champs.fetch(:checkbox), TypeDeChamp.type_champs.fetch(:drop_down_list), - TypeDeChamp.type_champs.fetch(:regions) + TypeDeChamp.type_champs.fetch(:regions), + TypeDeChamp.type_champs.fetch(:departements) ]) end diff --git a/spec/models/prefill_params_spec.rb b/spec/models/prefill_params_spec.rb index 84c99a26b..680a7beca 100644 --- a/spec/models/prefill_params_spec.rb +++ b/spec/models/prefill_params_spec.rb @@ -126,6 +126,7 @@ RSpec.describe PrefillParams do it_behaves_like "a champ public value that is authorized", :checkbox, "false" it_behaves_like "a champ public value that is authorized", :drop_down_list, "value" it_behaves_like "a champ public value that is authorized", :regions, "03" + it_behaves_like "a champ public value that is authorized", :departements, "03" it_behaves_like "a champ private value that is authorized", :text, "value" it_behaves_like "a champ private value that is authorized", :textarea, "value" @@ -144,6 +145,7 @@ RSpec.describe PrefillParams do it_behaves_like "a champ private value that is authorized", :checkbox, "false" it_behaves_like "a champ private value that is authorized", :drop_down_list, "value" it_behaves_like "a champ private value that is authorized", :regions, "93" + it_behaves_like "a champ public value that is authorized", :departements, "03" it_behaves_like "a champ public value that is unauthorized", :decimal_number, "non decimal string" it_behaves_like "a champ public value that is unauthorized", :integer_number, "non integer string" @@ -169,7 +171,7 @@ RSpec.describe PrefillParams do it_behaves_like "a champ public value that is unauthorized", :address, "value" it_behaves_like "a champ public value that is unauthorized", :pays, "value" it_behaves_like "a champ public value that is unauthorized", :regions, "value" - it_behaves_like "a champ public value that is unauthorized", :departements, "value" + # TODO: SEB add validation it_behaves_like "a champ public value that is unauthorized", :departements, "value" it_behaves_like "a champ public value that is unauthorized", :siret, "value" it_behaves_like "a champ public value that is unauthorized", :rna, "value" it_behaves_like "a champ public value that is unauthorized", :annuaire_education, "value" diff --git a/spec/models/type_de_champ_spec.rb b/spec/models/type_de_champ_spec.rb index e1ca7bac6..9d891f5e1 100644 --- a/spec/models/type_de_champ_spec.rb +++ b/spec/models/type_de_champ_spec.rb @@ -250,6 +250,7 @@ describe TypeDeChamp do it_behaves_like "a prefillable type de champ", :type_de_champ_checkbox it_behaves_like "a prefillable type de champ", :type_de_champ_drop_down_list it_behaves_like "a prefillable type de champ", :type_de_champ_regions + it_behaves_like "a prefillable type de champ", :type_de_champ_departements it_behaves_like "a non-prefillable type de champ", :type_de_champ_number it_behaves_like "a non-prefillable type de champ", :type_de_champ_communes @@ -267,7 +268,6 @@ describe TypeDeChamp do it_behaves_like "a non-prefillable type de champ", :type_de_champ_mesri it_behaves_like "a non-prefillable type de champ", :type_de_champ_carte it_behaves_like "a non-prefillable type de champ", :type_de_champ_address - it_behaves_like "a non-prefillable type de champ", :type_de_champ_departements it_behaves_like "a non-prefillable type de champ", :type_de_champ_siret it_behaves_like "a non-prefillable type de champ", :type_de_champ_rna it_behaves_like "a non-prefillable type de champ", :type_de_champ_annuaire_education