diff --git a/spec/support/shared_examples_for_prefilled_dossier.rb b/spec/support/shared_examples_for_prefilled_dossier.rb index ccd617370..3a85cac6f 100644 --- a/spec/support/shared_examples_for_prefilled_dossier.rb +++ b/spec/support/shared_examples_for_prefilled_dossier.rb @@ -24,6 +24,7 @@ shared_examples "the user has got a prefilled dossier, owned by themselves" do expect(page).to have_content(multiple_drop_down_list_values.first) expect(page).to have_content(multiple_drop_down_list_values.last) expect(page).to have_field(type_de_champ_epci.libelle, with: epci_value.last) + expect(page).to have_field(type_de_champ_dossier_link.libelle, with: dossier_link_value) expect(page).to have_selector("input[value='Vonnas (01540)']") end end diff --git a/spec/system/users/dossier_prefill_get_spec.rb b/spec/system/users/dossier_prefill_get_spec.rb index 86c9f55e6..9dbd69b46 100644 --- a/spec/system/users/dossier_prefill_get_spec.rb +++ b/spec/system/users/dossier_prefill_get_spec.rb @@ -13,6 +13,7 @@ describe 'Prefilling a dossier (with a GET request):', js: true do let(:type_de_champ_datetime) { create(:type_de_champ_datetime, procedure: procedure) } let(:type_de_champ_multiple_drop_down_list) { create(:type_de_champ_multiple_drop_down_list, procedure: procedure) } let(:type_de_champ_epci) { create(:type_de_champ_epci, procedure: procedure) } + let(:type_de_champ_dossier_link) { create(:type_de_champ_dossier_link, procedure: procedure) } let(:type_de_champ_commune) { create(:type_de_champ_communes, procedure: procedure) } let(:type_de_champ_repetition) { create(:type_de_champ_repetition, :with_types_de_champ, procedure: procedure) } @@ -28,6 +29,7 @@ describe 'Prefilling a dossier (with a GET request):', js: true do ] } let(:epci_value) { ['01', '200029999'] } + let(:dossier_link_value) { '42' } let(:commune_value) { ['01', '01457'] } # Vonnas (01540) let(:sub_type_de_champs_repetition) { procedure.active_revision.children_of(type_de_champ_repetition) } let(:text_repetition_libelle) { sub_type_de_champs_repetition.first.libelle } @@ -43,6 +45,7 @@ describe 'Prefilling a dossier (with a GET request):', js: true do "champ_#{type_de_champ_datetime.to_typed_id_for_query}" => datetime_value, "champ_#{type_de_champ_multiple_drop_down_list.to_typed_id_for_query}" => multiple_drop_down_list_values, "champ_#{type_de_champ_epci.to_typed_id_for_query}" => epci_value, + "champ_#{type_de_champ_dossier_link.to_typed_id_for_query}" => dossier_link_value, "champ_#{type_de_champ_commune.to_typed_id_for_query}" => commune_value, "champ_#{type_de_champ_siret.to_typed_id_for_query}" => siret_value, "champ_#{type_de_champ_rna.to_typed_id_for_query}" => rna_value, diff --git a/spec/system/users/dossier_prefill_post_spec.rb b/spec/system/users/dossier_prefill_post_spec.rb index 71ff2db90..b9e3d6a9c 100644 --- a/spec/system/users/dossier_prefill_post_spec.rb +++ b/spec/system/users/dossier_prefill_post_spec.rb @@ -13,6 +13,7 @@ describe 'Prefilling a dossier (with a POST request):', js: true do let(:type_de_champ_datetime) { create(:type_de_champ_datetime, procedure: procedure) } let(:type_de_champ_multiple_drop_down_list) { create(:type_de_champ_multiple_drop_down_list, procedure: procedure) } let(:type_de_champ_epci) { create(:type_de_champ_epci, procedure: procedure) } + let(:type_de_champ_dossier_link) { create(:type_de_champ_dossier_link, procedure: procedure) } let(:type_de_champ_repetition) { create(:type_de_champ_repetition, :with_types_de_champ, procedure: procedure) } let(:type_de_champ_commune) { create(:type_de_champ_communes, procedure: procedure) } @@ -34,6 +35,7 @@ describe 'Prefilling a dossier (with a POST request):', js: true do let(:integer_repetition_libelle) { sub_type_de_champs_repetition.second.libelle } let(:text_repetition_value) { "First repetition text" } let(:integer_repetition_value) { "42" } + let(:dossier_link_value) { '42' } before do allow(Rails).to receive(:cache).and_return(memory_store) @@ -157,6 +159,7 @@ describe 'Prefilling a dossier (with a POST request):', js: true do "champ_#{type_de_champ_datetime.to_typed_id_for_query}" => datetime_value, "champ_#{type_de_champ_multiple_drop_down_list.to_typed_id_for_query}" => multiple_drop_down_list_values, "champ_#{type_de_champ_epci.to_typed_id_for_query}" => epci_value, + "champ_#{type_de_champ_dossier_link.to_typed_id_for_query}" => dossier_link_value, "champ_#{type_de_champ_commune.to_typed_id_for_query}" => commune_value }.to_json JSON.parse(session.response.body)["dossier_url"].gsub("http://www.example.com", "")