From db6cd7d3f39640a8618c1a7923b381798bc2c42f Mon Sep 17 00:00:00 2001 From: Dushan Despotovic Date: Thu, 16 Jun 2022 11:43:15 +0100 Subject: [PATCH] WIP - adding schemes question to setup Freezing work on this currently as we're refactoring how the setup section is handled and most of the work on this ticket will be within the setup section. Doing this now would invovle having to redo work once that setup is complete so just adding this WIP in the meantime to return to this after the refactoring is done. --- config/forms/2021_2022.json | 20 ++++++++++++++++++++ spec/features/schemes_spec.rb | 11 +++++++++++ 2 files changed, 31 insertions(+) diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 8b4a8f983..f7177fc6b 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -34,6 +34,26 @@ } ] }, + "schemes": { + "header": "", + "description": "", + "questions": { + "scheme_name": { + "check_answer_label": "Scheme name", + "header": "What scheme is this log for?", + "hint_text": "", + "type": "select", + "answer_options": { + "": "Select an option" + } + } + }, + "depends_on": [ + { + "supported_housing_schemes_enabled?" : true + } + ] + }, "renewal": { "header": "", "description": "", diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index f772a24c8..7a2354b35 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -132,4 +132,15 @@ RSpec.describe "Supported housing scheme Features" do end end end + + context "when a data provider is setting up their supported housing lettings log" do + let(:case_log) { FactoryBot.create(:case_log, :in_progress) } + let!(:scheme) { FactoryBot.create(:scheme, service_name: "test scheme") } + + it "they are able to select a scheme from a list of schemes their organisation owns or manages" do + visit("#{case_log.id}/scheme") + expect(page).to have_content("What scheme is this log for?") + page.should have_select('scheme-selection', :options => ['test scheme']) + end + end end