From 608aed472aa326a55fd67f36c770ae200ccf6342 Mon Sep 17 00:00:00 2001 From: Dushan Despotovic Date: Thu, 18 Aug 2022 09:32:51 +0100 Subject: [PATCH] add feature specs --- spec/features/form/check_answers_page_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/features/form/check_answers_page_spec.rb b/spec/features/form/check_answers_page_spec.rb index 4e4253470..a206505e4 100644 --- a/spec/features/form/check_answers_page_spec.rb +++ b/spec/features/form/check_answers_page_spec.rb @@ -133,6 +133,19 @@ RSpec.describe "Form Check Answers Page" do end end + it "has no summary cards if the subsection is not household characteristics" do + visit("/logs/#{completed_case_log.id}/household-needs/check-answers") + assert_selector ".x-govuk-summary-card__title", count: 0 + end + + context "when the user is checking their answers for the household characteristics subsection" do + it "they see a seperate summary card for each member of the household" do + visit("/logs/#{completed_case_log.id}/#{subsection}/check-answers") + assert_selector ".x-govuk-summary-card__title", text: "Lead tenant", count: 1 + assert_selector ".x-govuk-summary-card__title", text: "Person 2", count: 1 + end + end + context "when viewing setup section answers" do before do FactoryBot.create(:location, scheme:)