From 5de141f829de9f35945dc96fd07283f2d7263bf5 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Tue, 26 Apr 2022 17:25:21 +0100 Subject: [PATCH] Update tests for DetailsTableHelper --- spec/helpers/details_table_helper_spec.rb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/spec/helpers/details_table_helper_spec.rb b/spec/helpers/details_table_helper_spec.rb index f0df11c14..4e5a518f8 100644 --- a/spec/helpers/details_table_helper_spec.rb +++ b/spec/helpers/details_table_helper_spec.rb @@ -7,8 +7,8 @@ RSpec.describe DetailsTableHelper do context "when given a simple attribute" do let(:attribute) { { name: "name", value: "Dummy org", editable: true } } - it "displays the string wrapped in a div" do - expect(details).to eq("
Dummy org
") + it "displays the string wrapped in a p" do + expect(details).to eq("

Dummy org

") end end @@ -27,5 +27,21 @@ RSpec.describe DetailsTableHelper do expect(details).to eq("") end end + + context "when given a bullet point list with one attibute" do + let(:list) { %w[Camden] } + let(:attribute) do + { + name: "local_authorities_operated_in", + value: list, + editable: false, + format: :bullet, + } + end + + it "displays the string wrapped in a p" do + expect(details).to eq("

Camden

") + end + end end end