Browse Source

Fix specs for new section

pull/108/head
baarkerlounger 4 years ago
parent
commit
1e09810a63
  1. 7
      app/models/case_log.rb
  2. 3
      db/schema.rb
  3. 2
      spec/factories/case_log.rb

7
app/models/case_log.rb

@ -114,7 +114,8 @@ class CaseLog < ApplicationRecord
enum unitletas: DbEnums.unitletas, _suffix: true enum unitletas: DbEnums.unitletas, _suffix: true
AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at].freeze AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at].freeze
OPTIONAL_FIELDS = %w[do_you_know_the_postcode do_you_know_the_local_authority].freeze OPTIONAL_FIELDS = %w[do_you_know_the_postcode do_you_know_the_local_authority
first_time_property_let_as_social_housing].freeze
def self.editable_fields def self.editable_fields
attribute_names - AUTOGENERATED_FIELDS attribute_names - AUTOGENERATED_FIELDS
@ -240,6 +241,10 @@ private
dynamically_not_required << "sale_completion_date" dynamically_not_required << "sale_completion_date"
end end
if la.present?
dynamically_not_required << "why_dont_you_know_la"
end
if tenancy == "Secure (including flexible)" if tenancy == "Secure (including flexible)"
dynamically_not_required << "tenancylength" dynamically_not_required << "tenancylength"
end end

3
db/schema.rb

@ -35,7 +35,6 @@ ActiveRecord::Schema.define(version: 2021_11_24_152204) do
t.integer "ethnic" t.integer "ethnic"
t.integer "national" t.integer "national"
t.integer "prevten" t.integer "prevten"
t.string "armed_forces"
t.integer "ecstat1" t.integer "ecstat1"
t.integer "hhmemb" t.integer "hhmemb"
t.string "relat2" t.string "relat2"
@ -70,7 +69,6 @@ ActiveRecord::Schema.define(version: 2021_11_24_152204) do
t.integer "underoccupation_benefitcap" t.integer "underoccupation_benefitcap"
t.integer "leftreg" t.integer "leftreg"
t.integer "reservist" t.integer "reservist"
t.string "armed_forces_partner"
t.integer "illness" t.integer "illness"
t.integer "preg_occ" t.integer "preg_occ"
t.string "accessibility_requirements" t.string "accessibility_requirements"
@ -165,7 +163,6 @@ ActiveRecord::Schema.define(version: 2021_11_24_152204) do
t.datetime "sale_completion_date" t.datetime "sale_completion_date"
t.datetime "startdate" t.datetime "startdate"
t.integer "armedforces" t.integer "armedforces"
t.string "property_postcode"
t.integer "first_time_property_let_as_social_housing" t.integer "first_time_property_let_as_social_housing"
t.string "why_dont_you_know_la" t.string "why_dont_you_know_la"
t.integer "unitletas" t.integer "unitletas"

2
spec/factories/case_log.rb

@ -135,6 +135,8 @@ FactoryBot.define do
sale_completion_date { nil } sale_completion_date { nil }
startdate { Time.zone.now } startdate { Time.zone.now }
armedforces { 1 } armedforces { 1 }
builtype { 1 }
unitletas { 2 }
end end
created_at { Time.zone.now } created_at { Time.zone.now }
updated_at { Time.zone.now } updated_at { Time.zone.now }

Loading…
Cancel
Save