From 6b5f38ce74ef90416270671ebb763ebb929e8cee Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Thu, 11 Aug 2022 14:00:45 +0200 Subject: [PATCH] spec --- spec/system/administrateurs/types_de_champ_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/system/administrateurs/types_de_champ_spec.rb b/spec/system/administrateurs/types_de_champ_spec.rb index 6b19f932e..4e9a45bb7 100644 --- a/spec/system/administrateurs/types_de_champ_spec.rb +++ b/spec/system/administrateurs/types_de_champ_spec.rb @@ -14,6 +14,16 @@ describe 'As an administrateur I can edit types de champ', js: true do expect(page).to have_content('Formulaire enregistré') end + scenario "adding a piece justificative template" do + add_champ + select('Pièce justificative', from: 'Type de champ') + + find('.attachment input[type=file]').attach_file(Rails.root + 'spec/fixtures/files/file.pdf') + + # Expect the files to be uploaded immediately + expect(page).to have_text('file.pdf') + end + scenario "adding multiple champs" do # Champs are created when clicking the 'Add field' button add_champs(count: 3)