feat(dossier): prefill region champ (#8442)

* make regions champ prefillable

* add possible and example value

* add external_id and value validation
This commit is contained in:
Sébastien Carceles 2023-01-24 12:25:17 +01:00 committed by GitHub
parent d629a5933a
commit 49ce255e29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 191 additions and 19 deletions

View file

@ -9,6 +9,8 @@ describe API::V2::GraphqlController do
let(:dossiers) { [dossier] }
let(:instructeur) { create(:instructeur, followed_dossiers: dossiers) }
let(:memory_store) { ActiveSupport::Cache.lookup_store(:memory_store) }
def compute_checksum_in_chunks(io)
Digest::MD5.new.tap do |checksum|
while (chunk = io.read(5.megabytes))
@ -37,6 +39,9 @@ describe API::V2::GraphqlController do
end
before do
allow(Rails).to receive(:cache).and_return(memory_store)
Rails.cache.clear
allow(APIGeoService).to receive(:departement_name).with('01').and_return('Ain')
instructeur.assign_to_procedure(procedure)
end
@ -392,7 +397,7 @@ describe API::V2::GraphqlController do
dossier
end
context "for individual" do
context "for individual", vcr: { cassette_name: 'api_geo_regions' } do
let(:procedure) { create(:procedure, :published, :for_individual, :with_service, :with_all_champs, :with_all_annotations, administrateurs: [admin]) }
let(:query) do
"{