diff --git a/spec/features/form/tasklist_page_spec.rb b/spec/features/form/tasklist_page_spec.rb index f0ecd6ea0..516360364 100644 --- a/spec/features/form/tasklist_page_spec.rb +++ b/spec/features/form/tasklist_page_spec.rb @@ -32,13 +32,13 @@ RSpec.describe "Task List" do end it "shows the number of completed sections if no sections are completed" do - visit("/logs/#{empty_case_log.id}") - expect(page).to have_content("You’ve completed 0 of 9 sections.") + visit("/case-logs/#{empty_case_log.id}") + expect(page).to have_content("You’ve completed 0 of 10 sections.") end it "shows the number of completed sections if one section is completed" do answer_all_questions_in_income_subsection(empty_case_log) - visit("/logs/#{empty_case_log.id}") - expect(page).to have_content("You’ve completed 1 of 9 sections.") + visit("/case-logs/#{empty_case_log.id}") + expect(page).to have_content("You’ve completed 1 of 10 sections.") end end diff --git a/spec/fixtures/forms/2021_2022.json b/spec/fixtures/forms/2021_2022.json index 50e362769..7e96cbf1f 100644 --- a/spec/fixtures/forms/2021_2022.json +++ b/spec/fixtures/forms/2021_2022.json @@ -222,6 +222,28 @@ } } }, + "about_this_log": { + "label": "About this log", + "subsections": { + "about_this_log": { + "label": "About this log", + "pages": { + "startdate": { + "header": "", + "description": "", + "questions": { + "startdate": { + "check_answer_label": "Tenancy start date", + "header": "What is the tenancy start date?", + "hint_text": "For example, 27 3 2007", + "type": "date" + } + } + } + } + } + } + }, "tenancy_and_property": { "label": "Tenancy and property information", "subsections": { diff --git a/spec/helpers/tasklist_helper_spec.rb b/spec/helpers/tasklist_helper_spec.rb index d55cd8258..1c77186ca 100644 --- a/spec/helpers/tasklist_helper_spec.rb +++ b/spec/helpers/tasklist_helper_spec.rb @@ -21,7 +21,7 @@ RSpec.describe TasklistHelper do describe "get sections count" do it "returns the total of sections if no status is given" do - expect(get_subsections_count(empty_case_log)).to eq(9) + expect(get_subsections_count(form, empty_case_log)).to eq(10) end it "returns 0 sections for completed sections if no sections are completed" do @@ -29,7 +29,7 @@ RSpec.describe TasklistHelper do end it "returns the number of not started sections" do - expect(get_subsections_count(empty_case_log, :not_started)).to eq(8) + expect(get_subsections_count(form, empty_case_log, :not_started)).to eq(9) end it "returns the number of sections in progress" do diff --git a/spec/requests/case_log_controller_spec.rb b/spec/requests/case_log_controller_spec.rb index dbf84065a..55c5adc30 100644 --- a/spec/requests/case_log_controller_spec.rb +++ b/spec/requests/case_log_controller_spec.rb @@ -200,7 +200,7 @@ RSpec.describe CaseLogsController, type: :request do end it "displays a section status for a case log" do - assert_select ".govuk-tag", text: /Not started/, count: 8 + assert_select ".govuk-tag", text: /Not started/, count: 9 assert_select ".govuk-tag", text: /Completed/, count: 0 assert_select ".govuk-tag", text: /Cannot start yet/, count: 1 end @@ -222,7 +222,7 @@ RSpec.describe CaseLogsController, type: :request do end it "displays a section status for a case log" do - assert_select ".govuk-tag", text: /Not started/, count: 7 + assert_select ".govuk-tag", text: /Not started/, count: 8 assert_select ".govuk-tag", text: /Completed/, count: 1 assert_select ".govuk-tag", text: /Cannot start yet/, count: 1 end