dont display tags on show if no label in procedure

This commit is contained in:
Lisa Durand 2024-10-16 16:38:16 +02:00
parent 84c2965edf
commit 1a3f73eb01
No known key found for this signature in database
GPG key ID: 0DF91F2CA1E8B816
2 changed files with 27 additions and 16 deletions

View file

@ -26,6 +26,7 @@
%p.fr-mb-1w
%small Lusager 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|

View file

@ -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")