add repasser_en_instruction to dossiers expirants

This commit is contained in:
Lisa Durand 2023-02-27 17:57:46 +01:00
parent e076981571
commit 07bb27a3af
2 changed files with 5 additions and 1 deletions

View file

@ -5,6 +5,9 @@
- elsif close_to_expiration || Dossier::TERMINE.include?(state)
%li{ 'data-turbo': 'true' }
- if close_to_expiration
= link_to repasser_en_instruction_instructeur_dossier_path(procedure_id, dossier_id), { class: 'fr-btn fr-btn--secondary fr-icon-edit-line' }.deep_merge!(post_method) do
Repasser en instruction
= link_to(repousser_expiration_instructeur_dossier_path(procedure_id, dossier_id), method: :post, class: "fr-btn") do
= t('instructeurs.dossiers.header.banner.button_delay_expiration')

View file

@ -108,7 +108,8 @@ describe 'instructeurs/dossiers/show.html.haml', type: :view do
it 'displays the correct actions' do
expect(subject).to have_text('Conserver un mois de plus')
expect(subject).to have_selector('.header-actions ul:first-child .fr-btn', count: 1)
expect(subject).to have_link('Repasser en instruction', href: repasser_en_instruction_instructeur_dossier_path(dossier.procedure, dossier))
expect(subject).to have_selector('.header-actions ul:first-child .fr-btn', count: 2)
end
end