renommage des tests

Co-authored-by: Pierre de La Morinerie <pierre.de_la_morinerie@beta.gouv.fr>
This commit is contained in:
Keirua 2020-07-21 17:11:40 +02:00 committed by clemkeirua
parent d31b4b6848
commit 1a53bfed62
2 changed files with 6 additions and 6 deletions

View file

@ -138,21 +138,21 @@ feature 'Instructing a dossier:' do
expect(page).to have_text("Dossier envoyé")
end
context 'A instructeur can download a zip of the attachments of a dossier', js: true do
context 'with dossiers having attached files', js: true do
let(:procedure) { create(:procedure, :published, :with_piece_justificative, instructeurs: [instructeur]) }
let(:dossier) { create(:dossier, :en_construction, procedure: procedure) }
let(:champ) { dossier.champs.first }
let(:path) { 'spec/fixtures/files/piece_justificative_0.pdf' }
let(:commentaire) { create(:commentaire, instructeur: instructeur, dossier: dossier) }
before {
before do
champ.piece_justificative_file.attach(io: File.open(path), filename: "piece_justificative_0.pdf", content_type: "application/pdf")
log_in(instructeur.email, password)
visit instructeur_dossier_path(procedure, dossier)
}
end
scenario 'it possible to open the zip file' do
scenario 'A instructeur can download an archive containing a single attachment' do
find(:css, '.attached').click
click_on 'Télécharger toutes les pièces jointes'
# For some reason, clicking the download link does not trigger the download in the headless browser ;
@ -168,7 +168,7 @@ feature 'Instructing a dossier:' do
expect(files[0].uncompressed_size).to be File.size(path)
end
scenario 'it possible to open the zip file with multiple attachments' do
scenario 'A instructeur can download an archive containing several identical attachments' do
commentaire.piece_jointe.attach(io: File.open(path), filename: "piece_justificative_0.pdf", content_type: "application/pdf")
visit telecharger_pjs_instructeur_dossier_path(procedure, dossier)

View file

@ -47,7 +47,7 @@ Capybara.register_driver :headless_chrome do |app|
download_path = Capybara.save_path
# Chromedriver 77 requires setting this for headless mode on linux
# Different versions of Chrome/selenium-webdriver require setting differently - jus set them all
# Different versions of Chrome/selenium-webdriver require setting differently - just set them all
options.add_preference('download.default_directory', download_path)
options.add_preference(:download, default_directory: download_path)