Browse Source

feat: update tests

pull/2338/head
natdeanlewissoftwire 9 months ago
parent
commit
0147705fce
  1. 2
      spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb
  2. 4
      spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb
  3. 2
      spec/services/bulk_upload/sales/year2024/row_parser_spec.rb

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

@ -698,7 +698,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
context "when non-setup questions are null" do context "when non-setup questions are null" do
let(:attributes) { setup_section_params.merge({ field_18: "", field_19: "", field_21: "" }) } let(:attributes) { setup_section_params.merge({ field_18: "", field_19: "", field_21: "" }) }
it "fetches the question's check_answer_label if it exists, otherwise it gets the question's header" do it "fetches the question's check_answer_label if it exists" do
parser.valid? parser.valid?
expect(parser.errors[:field_19]).to eql(["You must answer address line 1"]) expect(parser.errors[:field_19]).to eql(["You must answer address line 1"])
expect(parser.errors[:field_21]).to eql(["You must answer town or city"]) expect(parser.errors[:field_21]).to eql(["You must answer town or city"])

4
spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb

@ -793,7 +793,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
context "when non-setup questions are null" do context "when non-setup questions are null" do
let(:attributes) { setup_section_params.merge({ field_43: "" }) } let(:attributes) { setup_section_params.merge({ field_43: "" }) }
it "fetches the question's check_answer_label if it exists, otherwise it gets the question's header" do it "fetches the question's check_answer_label if it exists" do
parser.valid? parser.valid?
expect(parser.errors[:field_43]).to eql(["You must answer lead tenant’s gender identity"]) expect(parser.errors[:field_43]).to eql(["You must answer lead tenant’s gender identity"])
end end
@ -1398,7 +1398,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it "is not permitted as setup error" do it "is not permitted as setup error" do
setup_errors = parser.errors.select { |e| e.options[:category] == :setup } setup_errors = parser.errors.select { |e| e.options[:category] == :setup }
expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql("The managing organisation code is incorrect") expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql("You must answer managing organisation")
end end
it "blocks log creation" do it "blocks log creation" do

2
spec/services/bulk_upload/sales/year2024/row_parser_spec.rb

@ -287,7 +287,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do
context "when non-setup questions are null" do context "when non-setup questions are null" do
let(:attributes) { setup_section_params.merge({ field_32: "" }) } let(:attributes) { setup_section_params.merge({ field_32: "" }) }
it "fetches the question's check_answer_label if it exists, otherwise it gets the question's header" do it "fetches the question's check_answer_label if it exists" do
parser.valid? parser.valid?
expect(parser.errors[:field_32]).to eql(["You must answer buyer 1’s gender identity"]) expect(parser.errors[:field_32]).to eql(["You must answer buyer 1’s gender identity"])
end end

Loading…
Cancel
Save