dossiers: always allow to create a new dossier

Turns out this is confusing for users (some UI elements are present for
some procedures, but not for others).

Better enable it for everyone.
This commit is contained in:
Pierre de La Morinerie 2019-07-09 14:30:05 +02:00
parent 7634fb6d8a
commit b5ed74c09d
2 changed files with 4 additions and 9 deletions

View file

@ -1,5 +1,5 @@
- has_delete_action = dossier.can_be_deleted_by_user?
- has_new_dossier_action = dossier.procedure.expects_multiple_submissions? && dossier.procedure.accepts_new_dossiers?
- has_new_dossier_action = dossier.procedure.accepts_new_dossiers?
- has_actions = has_delete_action || has_new_dossier_action

View file

@ -1,5 +1,5 @@
describe 'users/dossiers/dossier_actions.html.haml', type: :view do
let(:procedure) { create(:procedure, :published, expects_multiple_submissions: true) }
let(:procedure) { create(:procedure, :published) }
let(:dossier) { create(:dossier, :en_construction, procedure: procedure) }
subject { render 'users/dossiers/dossier_actions.html.haml', dossier: dossier }
@ -12,18 +12,13 @@ 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) }
let(:procedure) { create(:procedure, :archived) }
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(:procedure) { create(:procedure, :archived) }
let(:dossier) { create(:dossier, :accepte, procedure: procedure) }
it 'doesnt render the menu at all' do