Browse Source

Update tests for DetailsTableHelper

pull/517/head
Paul Robert Lloyd 3 years ago
parent
commit
5de141f829
  1. 20
      spec/helpers/details_table_helper_spec.rb

20
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("<div>Dummy org</div>")
it "displays the string wrapped in a p" do
expect(details).to eq("<p class=\"govuk-body\">Dummy org</p>")
end
end
@ -27,5 +27,21 @@ RSpec.describe DetailsTableHelper do
expect(details).to eq("<ul class=\"govuk-list govuk-list--bullet\"><li>Camden</li><li>Westminster</li><li>Bristol</li></ul>")
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("<p class=\"govuk-body\">Camden</p>")
end
end
end
end

Loading…
Cancel
Save