Merge pull request #9282 from colinux/fix-description-notice
Fix: pas de crash pour afficher le lien de la notice de la démarche
This commit is contained in:
commit
34e074ff46
2 changed files with 13 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
- if link?
|
||||
= link_to url, t(".name"), class: "fr-download__link", title: new_tab_suffix(t(".name")), **external_link_attributes
|
||||
- elsif attachment?
|
||||
= render Dsfr::DownloadComponent.new(attachment:, name: t(".name"), ephemeral_link: administrateur_signed_in?)
|
||||
= render Dsfr::DownloadComponent.new(attachment:, name: t(".name"), ephemeral_link: helpers.administrateur_signed_in?)
|
||||
|
|
|
@ -34,6 +34,18 @@ describe 'shared/_procedure_description', type: :view do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when procedure has notice' do
|
||||
let(:procedure) { create(:procedure, :published, :with_notice) }
|
||||
before do
|
||||
allow(view).to receive(:administrateur_signed_in?).and_return(false)
|
||||
end
|
||||
|
||||
it 'shows a link to the notice' do
|
||||
subject
|
||||
expect(rendered).to have_link("Télécharger le guide de la démarche")
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the procedure has pieces jointes' do
|
||||
let(:procedure) { create(:procedure, :draft, :with_titre_identite, :with_piece_justificative, :with_siret) }
|
||||
it 'shows the pieces jointes list for draft procedure' do
|
||||
|
|
Loading…
Reference in a new issue