This commit is contained in:
Kara Diaby 2021-12-08 12:27:12 +01:00
parent 37e991ccb8
commit 598cb09c6d
5 changed files with 75 additions and 10 deletions

View file

@ -6,12 +6,12 @@ describe 'users/dossiers/dossier_actions.html.haml', type: :view do
subject { render 'users/dossiers/dossier_actions.html.haml', dossier: dossier, current_user: user }
it { is_expected.to have_link('Commencer un autre dossier', href: commencer_url(path: procedure.path)) }
it { is_expected.to have_link('Supprimer le dossier', href: ask_deletion_dossier_path(dossier)) }
it { is_expected.to have_link('Supprimer le dossier', href: delete_dossier_dossier_path(dossier)) }
it { is_expected.to have_link('Transferer le dossier', href: transferer_dossier_path(dossier)) }
context 'when the dossier cannot be deleted' do
context 'when the dossier is termine' do
let(:dossier) { create(:dossier, :accepte, procedure: procedure) }
it { is_expected.not_to have_link('Supprimer le dossier') }
it { is_expected.to have_link('Supprimer le dossier') }
end
context 'when the procedure is closed' do