From ec24ce3dadcb53430d2d67b4ad7b6783fbb06403 Mon Sep 17 00:00:00 2001 From: Benoit Queyron <72251526+Benoit-MINT@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:58:45 +0200 Subject: [PATCH] ajustement test PJ dossier en construction --- app/controllers/attachments_controller.rb | 1 - spec/system/users/en_construction_spec.rb | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 074a102ff..23fedafee 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -20,7 +20,6 @@ class AttachmentsController < ApplicationController @attachment = @blob.attachments.find(params[:id]) @attachment.purge_later flash.notice = 'La pièce jointe a bien été supprimée.' - if params[:dossier_id] @champ = find_champ else diff --git a/spec/system/users/en_construction_spec.rb b/spec/system/users/en_construction_spec.rb index f0fd43acf..ba662077e 100644 --- a/spec/system/users/en_construction_spec.rb +++ b/spec/system/users/en_construction_spec.rb @@ -30,6 +30,7 @@ describe "Dossier en_construction" do visit_dossier(dossier) click_on "Supprimer le fichier toto.txt" + expect(page).not_to have_text("toto.txt") input_selector = "#attachment-multiple-empty-#{champ.public_id}" expect(page).to have_selector(input_selector) @@ -37,7 +38,6 @@ describe "Dossier en_construction" do wait_until { champ.reload.for_export == 'file.pdf' } expect(page).to have_text("file.pdf") - expect(page).not_to have_text("toto.txt") end end @@ -54,13 +54,13 @@ describe "Dossier en_construction" do visit_dossier(dossier) click_on "Supprimer le fichier toto.png" + expect(page).not_to have_text("toto.png") input_selector = "##{champ.input_id}" expect(page).to have_selector(input_selector) find(input_selector).attach_file(Rails.root.join('spec/fixtures/files/file.pdf')) expect(page).to have_text("file.pdf") - expect(page).not_to have_text("toto.png") end end