Browse Source

feat: update tests

pull/1687/head
natdeanlewissoftwire 3 years ago
parent
commit
0bde65d6bb
  1. 2
      app/controllers/form_controller.rb
  2. 2
      app/models/log.rb
  3. 2
      spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

2
app/controllers/form_controller.rb

@ -95,7 +95,7 @@ private
next unless question_params
if %w[checkbox validation_override].include?(question.type)
question.answer_options.answer_keys_without_dividers.each do |option|
question.answer_keys_without_dividers.each do |option|
result[option] = question_params.include?(option) ? 1 : 0
end
else

2
app/models/log.rb

@ -107,7 +107,7 @@ class Log < ApplicationRecord
next if setup_ids.include?(error.attribute.to_s)
question = form.questions.find { |q| q.id == error.attribute.to_s }
if question.type == "checkbox"
if question&.type == "checkbox"
question.answer_keys_without_dividers.each { |attribute| public_send("#{attribute}=", nil) }
else
public_send("#{error.attribute}=", nil)

2
spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

@ -205,7 +205,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
field_101: "2",
field_102: "31",
field_104: "3",
field_105: "12",
field_105: "11",
field_106: "1",
field_107: "EC1N",

Loading…
Cancel
Save