dossiers: displays an "Start an other dossier" item in action dropdown

This commit is contained in:
Pierre de La Morinerie 2019-03-27 11:43:04 +01:00
parent d03e340345
commit abeb58caa5
3 changed files with 26 additions and 1 deletions

View file

@ -4,6 +4,7 @@ describe 'users/dossiers/dossier_actions.html.haml', type: :view do
subject { render 'users/dossiers/dossier_actions.html.haml', dossier: dossier }
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)) }
context 'when the dossier cannot be deleted' do
@ -11,7 +12,18 @@ describe 'users/dossiers/dossier_actions.html.haml', type: :view do
it { is_expected.not_to have_link('Supprimer le dossier') }
end
context 'when the procedure doesnt expect multiple submissions' do
let(:procedure) { create(:procedure, :published, expects_multiple_submissions: false) }
it { is_expected.not_to have_link('Commencer un autre dossier') }
end
context 'when the procedure is closed' do
let(:procedure) { create(:procedure, :archived, expects_multiple_submissions: true) }
it { is_expected.not_to have_link('Commencer un autre dossier') }
end
context 'when there are no actions to display' do
let(:procedure) { create(:procedure, :published, expects_multiple_submissions: false) }
let(:dossier) { create(:dossier, :accepte, procedure: procedure) }
it 'doesnt render the menu at all' do