diff --git a/db/schema.rb b/db/schema.rb index 7c9383cf0..20dbfc383 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -131,7 +131,6 @@ ActiveRecord::Schema.define(version: 2021_10_15_090040) do t.boolean "reasonable_preference_reason_medical_grounds" t.boolean "reasonable_preference_reason_avoid_hardship" t.boolean "reasonable_preference_reason_do_not_know" - t.integer "property_number_of_times_relet" t.datetime "discarded_at" t.index ["discarded_at"], name: "index_case_logs_on_discarded_at" end diff --git a/spec/models/case_log_spec.rb b/spec/models/case_log_spec.rb index d3e4d74a9..132705e67 100644 --- a/spec/models/case_log_spec.rb +++ b/spec/models/case_log_spec.rb @@ -57,6 +57,14 @@ RSpec.describe Form, type: :model do }.to raise_error(ActiveRecord::RecordInvalid) end end + context "reason for leaving last settled home validation" do + it "Reason for leaving must be don't know if reason for leaving settled home (Q9a) is don't know." do + expect { + CaseLog.create!(reason_for_leaving_last_settled_home: "Do not know", + benefit_cap_spare_room_subsidy: "Yes - benefit cap") + }.to raise_error(ActiveRecord::RecordInvalid) + end + end context "other reason for leaving last settled home validation" do it "must be provided if main reason for leaving last settled home was given as other" do expect {