Browse Source

add joint tenancy page

pull/193/head
MadeTech Dushan 4 years ago
parent
commit
58b4d5c936
  1. 17
      config/forms/2021_2022.json
  2. 7
      db/migrate/20211201152745_add_joint_tenancy_field.rb
  3. 1
      db/schema.rb
  4. 3
      spec/fixtures/complete_case_log.json
  5. 17
      spec/fixtures/forms/2021_2022.json
  6. 13
      spec/requests/case_log_controller_spec.rb

17
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": "",

7
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

1
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"

3
spec/fixtures/complete_case_log.json vendored

@ -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"
}
}

17
spec/fixtures/forms/2021_2022.json vendored

@ -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"
}
}
}
}
}
},

13
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

Loading…
Cancel
Save