views: fix misnamed textarea template

This commit is contained in:
Pierre de La Morinerie 2019-01-09 11:49:52 +01:00
parent 98be3d8186
commit 5719107cbc
2 changed files with 6 additions and 2 deletions

View file

@ -22,7 +22,7 @@
- when TypeDeChamp.type_champs.fetch(:siret)
= render partial: "shared/champs/siret/show", locals: { champ: c, profile: profile }
- when TypeDeChamp.type_champs.fetch(:textarea)
= render partial: "shared/champs/text_area/show", locals: { champ: c }
= render partial: "shared/champs/textarea/show", locals: { champ: c }
- else
= sanitize(c.to_s)

View file

@ -17,7 +17,8 @@ describe 'shared/dossiers/champs.html.haml', type: :view do
let(:champ2) { create(:champ, :header_section, value: "Section") }
let(:champ3) { create(:champ, :explication, value: "mazette") }
let(:champ4) { create(:champ, :dossier_link, value: dossier.id) }
let(:champs) { [champ1, champ2, champ3, champ4] }
let(:champ5) { create(:champ_textarea, value: "Some long text in a textarea.") }
let(:champs) { [champ1, champ2, champ3, champ4, champ5] }
before { dossier.avis << avis }
@ -32,6 +33,9 @@ describe 'shared/dossiers/champs.html.haml', type: :view do
it { is_expected.to have_link("Dossier nº #{dossier.id}") }
it { is_expected.to include(dossier.text_summary) }
it { is_expected.to include(champ5.libelle) }
it { is_expected.to include(champ5.libelle) }
end
context "with a dossier champ, but we are not authorized to acces the dossier" do