dont display tags on show if no label in procedure
This commit is contained in:
parent
84c2965edf
commit
1a3f73eb01
2 changed files with 27 additions and 16 deletions
|
@ -26,6 +26,7 @@
|
|||
%p.fr-mb-1w
|
||||
%small L’usager a supprimé son compte. Vous pouvez archiver puis supprimer le dossier.
|
||||
|
||||
- if dossier.procedure.procedure_labels.present?
|
||||
.fr-mb-3w
|
||||
- if dossier.procedure_labels.present?
|
||||
- dossier.procedure_labels.each do |label|
|
||||
|
|
|
@ -221,6 +221,16 @@ describe 'instructeurs/dossiers/show', type: :view do
|
|||
describe "Dossier labels" do
|
||||
let(:procedure) { create(:procedure, :with_labels) }
|
||||
let(:dossier) { create(:dossier, :en_construction, procedure:) }
|
||||
|
||||
context "Procedure without labels" do
|
||||
let(:procedure_without_labels) { create(:procedure) }
|
||||
let(:dossier) { create(:dossier, :en_construction, procedure: procedure_without_labels) }
|
||||
it 'does not display button to add label or dropdown' do
|
||||
expect(subject).not_to have_text("Ajouter un label")
|
||||
expect(subject).not_to have_text("à relancer")
|
||||
end
|
||||
end
|
||||
|
||||
context "Dossier without labels" do
|
||||
it 'displays button with text to add label' do
|
||||
expect(subject).to have_text("Ajouter un label")
|
||||
|
|
Loading…
Reference in a new issue