From d55381e613c67ea11ae77e972bc06a3281e68161 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 4 Feb 2025 17:37:30 +0000 Subject: [PATCH] Test page headers --- spec/features/sales_log_spec.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/spec/features/sales_log_spec.rb b/spec/features/sales_log_spec.rb index b94ecd464..2670474db 100644 --- a/spec/features/sales_log_spec.rb +++ b/spec/features/sales_log_spec.rb @@ -228,6 +228,31 @@ RSpec.describe "Sales Log Features" do expect(page).to have_current_path("/sales-logs/csv-download?codes_only=false&search=1") end end + + context "when displaying the question number in the page header" do + let(:sales_log) { FactoryBot.create(:sales_log, :shared_ownership_setup_complete, jointpur: 2, owning_organisation: user.organisation, assigned_to: user) } + + context "when visiting the address page" do + before do + visit("/sales-logs/#{sales_log.id}/address") + end + + it "displays the question number in the page header" do + expect(page).to have_content("Q16") + end + end + + context "when visiting the about staircasing page" do + before do + visit("/sales-logs/#{sales_log.id}/about-staircasing-not-joint-purchase") + end + + it "displays the question number in the page header" do + expect(page).to have_content(/Shared ownership scheme\s*About the staircasing transaction/) + end + end + + end end end @@ -837,4 +862,6 @@ RSpec.describe "Sales Log Features" do end end end + + end