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:
parent
7634fb6d8a
commit
b5ed74c09d
2 changed files with 4 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
- has_delete_action = dossier.can_be_deleted_by_user?
|
- 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
|
- has_actions = has_delete_action || has_new_dossier_action
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
describe 'users/dossiers/dossier_actions.html.haml', type: :view do
|
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) }
|
let(:dossier) { create(:dossier, :en_construction, procedure: procedure) }
|
||||||
|
|
||||||
subject { render 'users/dossiers/dossier_actions.html.haml', dossier: dossier }
|
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') }
|
it { is_expected.not_to have_link('Supprimer le dossier') }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when the procedure doesn’t 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
|
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') }
|
it { is_expected.not_to have_link('Commencer un autre dossier') }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when there are no actions to display' do
|
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) }
|
let(:dossier) { create(:dossier, :accepte, procedure: procedure) }
|
||||||
|
|
||||||
it 'doesn’t render the menu at all' do
|
it 'doesn’t render the menu at all' do
|
||||||
|
|
Loading…
Reference in a new issue