diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index ab9bf89ab..ed315eafd 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -1054,6 +1054,23 @@ "label": "Tenancy information", "depends_on": { "about_this_log": "completed" }, "pages": { + "joint_tenancy": { + "header": "", + "description": "", + "questions": { + "jointtenancy": { + "check_answer_label": "Is this a joint tenancy?", + "header": "Is this a joint tenancy?", + "hint_text": "", + "type": "radio", + "answer_options": { + "0": "Yes", + "1": "No", + "2": "Don't know" + } + } + } + }, "starter_tenancy": { "header": "", "description": "", diff --git a/db/migrate/20211201152745_add_joint_tenancy_field.rb b/db/migrate/20211201152745_add_joint_tenancy_field.rb new file mode 100644 index 000000000..22c8ced87 --- /dev/null +++ b/db/migrate/20211201152745_add_joint_tenancy_field.rb @@ -0,0 +1,7 @@ +class AddJointTenancyField < ActiveRecord::Migration[6.1] + def change + change_table :case_logs, bulk: true do |t| + t.column :joint_tenancy, :integer + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 45a2d88f0..caebd4676 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -178,6 +178,7 @@ ActiveRecord::Schema.define(version: 2022_01_07_103143) do t.integer "totelder" t.integer "totadult" t.integer "net_income_known" + t.integer "joint_tenancy" t.index ["discarded_at"], name: "index_case_logs_on_discarded_at" t.index ["managing_organisation_id"], name: "index_case_logs_on_managing_organisation_id" t.index ["owning_organisation_id"], name: "index_case_logs_on_owning_organisation_id" diff --git a/spec/fixtures/complete_case_log.json b/spec/fixtures/complete_case_log.json index 785ddf9eb..bce802c76 100644 --- a/spec/fixtures/complete_case_log.json +++ b/spec/fixtures/complete_case_log.json @@ -144,6 +144,7 @@ "property_wheelchair_accessible": "Yes", "void_or_renewal_date": "05/05/2020", "tenant_same_property_renewal": "Yes", - "new_build_handover_date": "01/01/2019" + "new_build_handover_date": "01/01/2019", + "joint_tenancy": "Yes" } } diff --git a/spec/fixtures/forms/2021_2022.json b/spec/fixtures/forms/2021_2022.json index 230b195b2..61cb5a16c 100644 --- a/spec/fixtures/forms/2021_2022.json +++ b/spec/fixtures/forms/2021_2022.json @@ -237,6 +237,23 @@ "width": 10 } } + }, + "joint_tenancy": { + "header": "", + "description": "", + "questions": { + "jointtenancy": { + "check_answer_label": "Is this a joint tenancy?", + "header": "Is this a joint tenancy?", + "hint_text": "", + "type": "radio", + "answer_options": { + "0": "Yes", + "1": "No", + "2": "Don't know" + } + } + } } } }, diff --git a/spec/requests/case_log_controller_spec.rb b/spec/requests/case_log_controller_spec.rb index e27a57f41..a895b236a 100644 --- a/spec/requests/case_log_controller_spec.rb +++ b/spec/requests/case_log_controller_spec.rb @@ -240,6 +240,19 @@ RSpec.describe CaseLogsController, type: :request do end end end + + context "tenancy information pages" do + let(:headers) { { "Accept" => "text/html" } } + + before do + sign_in user + get "/case_logs/#{case_log.id}/joint_tenancy", headers: headers, params: { case_log_id: case_log.id } + end + + it "has a joint tenancy page that can be visited" do + expect(response).to have_http_status(:success) + end + end end context "Check answers" do