feat(demarche): describe procedure prefilling (#8187)
* feat(demarche): description Show the description of an opendata procedure (published or draft), with help about how to prefill a dossier for this procedure. Co-authored-by: Damien Le Thiec <damien.lethiec@gmail.com>
This commit is contained in:
parent
936a1bfd91
commit
0a10a08c21
20 changed files with 497 additions and 26 deletions
21
spec/system/integrateurs/procedure_prefilling_spec.rb
Normal file
21
spec/system/integrateurs/procedure_prefilling_spec.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
describe 'As an integrator:', js: true do
|
||||
let(:procedure) { create(:procedure, :published, opendata: true) }
|
||||
let!(:type_de_champ) { create(:type_de_champ_text, procedure: procedure) }
|
||||
|
||||
before { visit "/preremplir/#{procedure.path}" }
|
||||
|
||||
scenario 'I can read the procedure prefilling (aka public champs)' do
|
||||
expect(page).to have_content(type_de_champ.to_typed_id)
|
||||
expect(page).to have_content(I18n.t("activerecord.attributes.type_de_champ.type_champs.#{type_de_champ.type_champ}"))
|
||||
expect(page).to have_content(type_de_champ.libelle)
|
||||
expect(page).to have_content(type_de_champ.description)
|
||||
end
|
||||
|
||||
scenario 'I can select champs to prefill' do
|
||||
click_on 'Ajouter'
|
||||
|
||||
prefill_description = PrefillDescription.new(procedure)
|
||||
prefill_description.update(selected_type_de_champ_ids: [type_de_champ.id.to_s])
|
||||
expect(page).to have_content(prefill_description.prefill_link)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue