From fd07a88ed6e359596b565495fe87f7e63e1d9987 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Wed, 26 Apr 2017 12:46:57 +0200 Subject: [PATCH] =?UTF-8?q?Add=20a=20missing=20test=20to=20the=20=5Frender?= =?UTF-8?q?=5Flist=5Fchamps=20template=E2=80=99s=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../champs/_render_list_champs.html.haml_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/views/users/description/champs/_render_list_champs.html.haml_spec.rb b/spec/views/users/description/champs/_render_list_champs.html.haml_spec.rb index 4e8982faf..233114a9b 100644 --- a/spec/views/users/description/champs/_render_list_champs.html.haml_spec.rb +++ b/spec/views/users/description/champs/_render_list_champs.html.haml_spec.rb @@ -1,6 +1,18 @@ describe 'users/description/champs/render_list_champs.html.haml', type: :view do let(:type_champ) { create(:type_de_champ_public, :checkbox) } + context "with any champ" do + let!(:champ) { create(:champ, type_de_champ: type_champ, value: nil) } + + before do + render 'users/description/champs/render_list_champs.html.haml', champs: Champ.all, order_place: 0 + end + + it "should render the champ's libelle" do + expect(rendered).to have_content(champ.libelle) + end + end + context "with a checkbox champ" do context "whose value equals nil" do let!(:champ_checkbox_checked) { create(:champ, type_de_champ: type_champ, value: nil) }