ajustement test PJ dossier en construction

This commit is contained in:
Benoit Queyron 2024-07-15 16:58:45 +02:00
parent 249da03287
commit ec24ce3dad
No known key found for this signature in database
GPG key ID: 9E723480C7317E22
2 changed files with 2 additions and 3 deletions

View file

@ -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

View file

@ -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