Merge pull request #6513 from betagouv/preview_in_new_tab

Administrateur : l’aperçu d'une démarche s’ouvre maintenant dans un nouvel onglet (#6512)
This commit is contained in:
Pierre de La Morinerie 2021-10-05 10:57:25 +02:00 committed by GitHub
commit 9ec5a22521
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -4,7 +4,7 @@
metadatas: ["Créée le #{@procedure.created_at.strftime('%d/%m/%Y')} - n° #{@procedure.id}", "#{@procedure.close? ? "Close le #{@procedure.closed_at.strftime('%d/%m/%Y')}" : @procedure.locked? ? "Publiée - #{procedure_lien(@procedure)}" : "Brouillon"}"] }
.container.procedure-admin-container
= link_to apercu_admin_procedure_path(@procedure), class: 'button', id: "preview-procedure" do
= link_to apercu_admin_procedure_path(@procedure), target: "_blank", rel: "noopener", class: 'button', id: "preview-procedure" do
%span.icon.preview
Prévisualiser

View file

@ -77,10 +77,11 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
click_on Procedure.last.libelle
find('#preview-procedure').click
expect(page).to have_current_path(apercu_admin_procedure_path(Procedure.last))
expect(page).to have_field('libelle de champ')
preview_window = window_opened_by { find('#preview-procedure').click }
within_window(preview_window) do
expect(page).to have_current_path(apercu_admin_procedure_path(Procedure.last))
expect(page).to have_field('libelle de champ')
end
end
scenario 'After adding champ and file, make publication' do