diff --git a/app/views/dossiers/show.pdf.prawn b/app/views/dossiers/show.pdf.prawn index a2a451765..bf1396868 100644 --- a/app/views/dossiers/show.pdf.prawn +++ b/app/views/dossiers/show.pdf.prawn @@ -212,7 +212,7 @@ def add_avis(pdf, avis) format_in_2_lines(pdf, "Avis de #{avis.email_to_display}#{avis.confidentiel? ? ' (confidentiel)' : ''}", avis.answer || 'En attente de réponse') - if avis.question_answer.present? + if [true, false].include? avis.question_answer format_in_2_columns(pdf, "Réponse oui/non ", t("question_answer.#{avis.question_answer}", scope: 'helpers.label')) end end diff --git a/app/views/experts/avis/shared/_list.html.haml b/app/views/experts/avis/shared/_list.html.haml index 962d6813d..d6d38b166 100644 --- a/app/views/experts/avis/shared/_list.html.haml +++ b/app/views/experts/avis/shared/_list.html.haml @@ -37,6 +37,6 @@ - if avis.piece_justificative_file.attached? = render Attachment::ShowComponent.new(attachment: avis.piece_justificative_file.attachment) .answer-body - - if avis.question_answer + - if [true, false].include? avis.question_answer %p= t("question_answer.#{avis.question_answer}", scope: 'helpers.label') = render SimpleFormatComponent.new(avis.answer, allow_a: false) diff --git a/app/views/instructeurs/avis/_list.html.haml b/app/views/instructeurs/avis/_list.html.haml index 91577ddbf..34afa12ae 100644 --- a/app/views/instructeurs/avis/_list.html.haml +++ b/app/views/instructeurs/avis/_list.html.haml @@ -53,7 +53,7 @@ - if avis.piece_justificative_file.attached? = render Attachment::ShowComponent.new(attachment: avis.piece_justificative_file.attachment) .answer-body - - if avis.question_answer + - if [true, false].include? avis.question_answer %p= t("question_answer.#{avis.question_answer}", scope: 'helpers.label') = render SimpleFormatComponent.new(avis.answer, allow_a: false) diff --git a/spec/system/experts/expert_spec.rb b/spec/system/experts/expert_spec.rb index f9538921b..67fb2eb90 100644 --- a/spec/system/experts/expert_spec.rb +++ b/spec/system/experts/expert_spec.rb @@ -110,6 +110,10 @@ describe 'Inviting an expert:' do expect(page).to have_content('Ma réponse d’expert.') expect(page).to have_content('non') + click_on 'Voir les avis' + expect(page).to have_text('Vous') + expect(page).to have_text('non') + within('.breadcrumbs') { click_on 'Avis' } expect(page).to have_text('1 avis donné') end