From b20e618f2f3e7c05ef74bbe70aa277ea0fa1fa5b Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Mon, 11 Mar 2024 11:08:24 +0000 Subject: [PATCH] feat: update tests --- app/services/bulk_upload/lettings/year2024/row_parser.rb | 2 +- app/services/bulk_upload/sales/year2024/row_parser.rb | 2 +- spec/models/form/lettings/questions/uprn_selection_spec.rb | 4 ++-- spec/models/form/sales/questions/uprn_selection_spec.rb | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/services/bulk_upload/lettings/year2024/row_parser.rb b/app/services/bulk_upload/lettings/year2024/row_parser.rb index 1bff97821..3496e0db0 100644 --- a/app/services/bulk_upload/lettings/year2024/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2024/row_parser.rb @@ -1229,7 +1229,7 @@ private attributes["county"] = field_20 attributes["address_line1_input"] = address_line1_input attributes["postcode_full_input"] = postcode_full - attributes["select_best_address_match"] = true + attributes["select_best_address_match"] = true if field_16.blank? attributes end diff --git a/app/services/bulk_upload/sales/year2024/row_parser.rb b/app/services/bulk_upload/sales/year2024/row_parser.rb index 0cb51a9e4..2132c5e59 100644 --- a/app/services/bulk_upload/sales/year2024/row_parser.rb +++ b/app/services/bulk_upload/sales/year2024/row_parser.rb @@ -944,7 +944,7 @@ private attributes["county"] = field_26 attributes["address_line1_input"] = address_line1_input attributes["postcode_full_input"] = postcode_full - attributes["select_best_address_match"] = true + attributes["select_best_address_match"] = true if field_22.blank? attributes["ethnic_group2"] = infer_buyer2_ethnic_group_from_ethnic attributes["ethnicbuy2"] = field_40 diff --git a/spec/models/form/lettings/questions/uprn_selection_spec.rb b/spec/models/form/lettings/questions/uprn_selection_spec.rb index 63e5b14fb..9d863967d 100644 --- a/spec/models/form/lettings/questions/uprn_selection_spec.rb +++ b/spec/models/form/lettings/questions/uprn_selection_spec.rb @@ -60,14 +60,14 @@ RSpec.describe Form::Lettings::Questions::UprnSelection, type: :model do stub_request(:get, /api.os.uk/) .to_return(status: 200, body: "", headers: {}) - expect(question.answer_options(log)).to eq({ "100" => { "value" => "The address is not listed, I want to enter the address manually" }, "0" => { "value" => "full address" }, "divider" => { "value" => true } }) + expect(question.answer_options(log)).to eq({ "uprn_not_listed" => { "value" => "The address is not listed, I want to enter the address manually" }, "UPRN" => { "value" => "full address" }, "divider" => { "value" => true } }) end it "has the correct displayed answer options" do stub_request(:get, /api.os.uk/) .to_return(status: 200, body: "", headers: {}) - expect(question.displayed_answer_options(log)).to eq({ "100" => { "value" => "The address is not listed, I want to enter the address manually" }, "0" => { "value" => "full address" }, "divider" => { "value" => true } }) + expect(question.displayed_answer_options(log)).to eq({ "uprn_not_listed" => { "value" => "The address is not listed, I want to enter the address manually" }, "UPRN" => { "value" => "full address" }, "divider" => { "value" => true } }) end it "has the correct inferred check answers value" do diff --git a/spec/models/form/sales/questions/uprn_selection_spec.rb b/spec/models/form/sales/questions/uprn_selection_spec.rb index aa9d7889c..36eee429b 100644 --- a/spec/models/form/sales/questions/uprn_selection_spec.rb +++ b/spec/models/form/sales/questions/uprn_selection_spec.rb @@ -60,14 +60,14 @@ RSpec.describe Form::Sales::Questions::UprnSelection, type: :model do stub_request(:get, /api.os.uk/) .to_return(status: 200, body: "", headers: {}) - expect(question.answer_options(log)).to eq({ "100" => { "value" => "The address is not listed, I want to enter the address manually" }, "0" => { "value" => "full address" }, "divider" => { "value" => true } }) + expect(question.answer_options(log)).to eq({ "uprn_not_listed" => { "value" => "The address is not listed, I want to enter the address manually" }, "UPRN" => { "value" => "full address" }, "divider" => { "value" => true } }) end it "has the correct displayed answer options" do stub_request(:get, /api.os.uk/) .to_return(status: 200, body: "", headers: {}) - expect(question.displayed_answer_options(log)).to eq({ "100" => { "value" => "The address is not listed, I want to enter the address manually" }, "0" => { "value" => "full address" }, "divider" => { "value" => true } }) + expect(question.displayed_answer_options(log)).to eq({ "uprn_not_listed" => { "value" => "The address is not listed, I want to enter the address manually" }, "UPRN" => { "value" => "full address" }, "divider" => { "value" => true } }) end it "has the correct inferred check answers value" do