From ebdfbf1cc0eb261ffd01e025a77c6377beee4145 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Fri, 6 Oct 2023 12:38:48 +0100 Subject: [PATCH] feat: update tests --- spec/requests/schemes_controller_spec.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index af2d94666..9d322ec87 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -2196,7 +2196,20 @@ RSpec.describe SchemesController, type: :request do expect(response).to have_http_status(:ok) expect(page).to have_content("Scheme details") expect(page).to have_content("This scheme contains confidential information") - expect(page).to have_content("Which organisation owns the housing stock for this scheme?") + end + + context "when there are stock owners" do + let(:parent_organisation) { create(:organisation) } + + before do + create(:organisation_relationship, parent_organisation:, child_organisation: user.organisation) + get "/schemes/#{scheme.id}/edit-name" + end + + it "includes the owning organisation question" do + expect(response).to have_http_status(:ok) + expect(page).to have_content("Which organisation owns the housing stock for this scheme?") + end end context "when attempting to access secondary-client-group scheme page for another organisation" do