Browse Source

feat: update tests

pull/2187/head
natdeanlewissoftwire 2 years ago committed by Kat
parent
commit
4943f2c90e
  1. 2
      app/services/csv/lettings_log_csv_service.rb
  2. 1
      spec/factories/lettings_log.rb
  3. 2
      spec/services/csv/lettings_log_csv_service_spec.rb

2
app/services/csv/lettings_log_csv_service.rb

@ -263,7 +263,7 @@ module Csv
"renttype" => RENTTYPE_LABELS, "renttype" => RENTTYPE_LABELS,
}.freeze }.freeze
CONVENTIONAL_YES_NO_ATTRIBUTES = %w[illness_type_1 illness_type_2 illness_type_3 illness_type_4 illness_type_5 illness_type_6 illness_type_7 illness_type_8 illness_type_9 illness_type_10 refused cbl cap chr letting_allocation_none housingneeds_a housingneeds_b housingneeds_c housingneeds_d housingneeds_e housingneeds_f housingneeds_g housingneeds_h has_benefits nocharge postcode_known].freeze CONVENTIONAL_YES_NO_ATTRIBUTES = %w[illness_type_1 illness_type_2 illness_type_3 illness_type_4 illness_type_5 illness_type_6 illness_type_7 illness_type_8 illness_type_9 illness_type_10 refused cbl cap chr accessible_register letting_allocation_none housingneeds_a housingneeds_b housingneeds_c housingneeds_d housingneeds_e housingneeds_f housingneeds_g housingneeds_h has_benefits nocharge postcode_known].freeze
YES_OR_BLANK_ATTRIBUTES = %w[declaration rp_homeless rp_insan_unsat rp_medwel rp_hardship rp_dontknow].freeze YES_OR_BLANK_ATTRIBUTES = %w[declaration rp_homeless rp_insan_unsat rp_medwel rp_hardship rp_dontknow].freeze

1
spec/factories/lettings_log.rb

@ -112,6 +112,7 @@ FactoryBot.define do
cbl { 0 } cbl { 0 }
chr { 1 } chr { 1 }
cap { 0 } cap { 0 }
accessible_register { 0 }
reasonother { nil } reasonother { nil }
housingneeds { 1 } housingneeds { 1 }
housingneeds_type { 0 } housingneeds_type { 0 }

2
spec/services/csv/lettings_log_csv_service_spec.rb

@ -101,7 +101,7 @@ RSpec.describe Csv::LettingsLogCsvService do
let(:questions) do let(:questions) do
[ [
build(:question, id: "condition_effects", type: "checkbox", answer_options: { "illness_type_1" => {}, "illness_type_2" => {}, "illness_type_3" => {} }), build(:question, id: "condition_effects", type: "checkbox", answer_options: { "illness_type_1" => {}, "illness_type_2" => {}, "illness_type_3" => {} }),
build(:question, id: "letting_allocation", type: "checkbox", answer_options: { "cbl" => {}, "cap" => {}, "chr" => {} }), build(:question, id: "letting_allocation", type: "checkbox", answer_options: { "cbl" => {}, "cap" => {}, "chr" => {}, "accessible_register" => {} }),
] ]
end end

Loading…
Cancel
Save