Browse Source

CLDC/477 Code review updates

pull/59/head
Matthew Phelan 3 years ago
parent
commit
b724c99985
  1. 1
      db/schema.rb
  2. 8
      spec/models/case_log_spec.rb

1
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_medical_grounds"
t.boolean "reasonable_preference_reason_avoid_hardship" t.boolean "reasonable_preference_reason_avoid_hardship"
t.boolean "reasonable_preference_reason_do_not_know" t.boolean "reasonable_preference_reason_do_not_know"
t.integer "property_number_of_times_relet"
t.datetime "discarded_at" t.datetime "discarded_at"
t.index ["discarded_at"], name: "index_case_logs_on_discarded_at" t.index ["discarded_at"], name: "index_case_logs_on_discarded_at"
end end

8
spec/models/case_log_spec.rb

@ -57,6 +57,14 @@ RSpec.describe Form, type: :model do
}.to raise_error(ActiveRecord::RecordInvalid) }.to raise_error(ActiveRecord::RecordInvalid)
end end
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 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 it "must be provided if main reason for leaving last settled home was given as other" do
expect { expect {

Loading…
Cancel
Save