Browse Source

feat: update some tests

pull/1696/head
natdeanlewissoftwire 3 years ago
parent
commit
a9de740914
  1. 2
      spec/models/form/lettings/questions/address_line1_spec.rb
  2. 2
      spec/models/form/lettings/questions/county_spec.rb
  3. 2
      spec/models/form/lettings/questions/postcode_for_full_address_spec.rb
  4. 2
      spec/models/form/lettings/questions/town_or_city_spec.rb
  5. 2
      spec/models/form/sales/questions/address_line1_spec.rb
  6. 2
      spec/models/form/sales/questions/county_spec.rb
  7. 2
      spec/models/form/sales/questions/postcode_for_full_address_spec.rb
  8. 2
      spec/models/form/sales/questions/town_or_city_spec.rb
  9. 8
      spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

2
spec/models/form/lettings/questions/address_line1_spec.rb

@ -24,7 +24,7 @@ RSpec.describe Form::Lettings::Questions::AddressLine1, type: :model do
end end
it "has the correct check_answer_label" do it "has the correct check_answer_label" do
expect(question.check_answer_label).to eq("Q12 - Address") expect(question.check_answer_label).to eq("Q12 - Address lines 1 and 2")
end end
it "has the correct type" do it "has the correct type" do

2
spec/models/form/lettings/questions/county_spec.rb

@ -20,7 +20,7 @@ RSpec.describe Form::Lettings::Questions::County, type: :model do
end end
it "has the correct check_answer_label" do it "has the correct check_answer_label" do
expect(question.check_answer_label).to be_nil expect(question.check_answer_label).to eq("Q12 - County")
end end
it "has the correct type" do it "has the correct type" do

2
spec/models/form/lettings/questions/postcode_for_full_address_spec.rb

@ -20,7 +20,7 @@ RSpec.describe Form::Lettings::Questions::PostcodeForFullAddress, type: :model d
end end
it "has the correct check_answer_label" do it "has the correct check_answer_label" do
expect(question.check_answer_label).to be_nil expect(question.check_answer_label).to eq("Q12 - Postcode")
end end
it "has the correct type" do it "has the correct type" do

2
spec/models/form/lettings/questions/town_or_city_spec.rb

@ -20,7 +20,7 @@ RSpec.describe Form::Lettings::Questions::TownOrCity, type: :model do
end end
it "has the correct check_answer_label" do it "has the correct check_answer_label" do
expect(question.check_answer_label).to be_nil expect(question.check_answer_label).to eq("Q12 - Town or city")
end end
it "has the correct type" do it "has the correct type" do

2
spec/models/form/sales/questions/address_line1_spec.rb

@ -24,7 +24,7 @@ RSpec.describe Form::Sales::Questions::AddressLine1, type: :model do
end end
it "has the correct check_answer_label" do it "has the correct check_answer_label" do
expect(question.check_answer_label).to eq("Q15 - Address") expect(question.check_answer_label).to eq("Q15 - Address lines 1 and 2")
end end
it "has the correct type" do it "has the correct type" do

2
spec/models/form/sales/questions/county_spec.rb

@ -20,7 +20,7 @@ RSpec.describe Form::Sales::Questions::County, type: :model do
end end
it "has the correct check_answer_label" do it "has the correct check_answer_label" do
expect(question.check_answer_label).to be_nil expect(question.check_answer_label).to eq("Q15 - County")
end end
it "has the correct type" do it "has the correct type" do

2
spec/models/form/sales/questions/postcode_for_full_address_spec.rb

@ -20,7 +20,7 @@ RSpec.describe Form::Sales::Questions::PostcodeForFullAddress, type: :model do
end end
it "has the correct check_answer_label" do it "has the correct check_answer_label" do
expect(question.check_answer_label).to be_nil expect(question.check_answer_label).to eq("Q15 - Postcode")
end end
it "has the correct type" do it "has the correct type" do

2
spec/models/form/sales/questions/town_or_city_spec.rb

@ -20,7 +20,7 @@ RSpec.describe Form::Sales::Questions::TownOrCity, type: :model do
end end
it "has the correct check_answer_label" do it "has the correct check_answer_label" do
expect(question.check_answer_label).to be_nil expect(question.check_answer_label).to eq("Q15 - Town or city")
end end
it "has the correct type" do it "has the correct type" do

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

@ -340,8 +340,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
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, otherwise it gets the question's header" do
parser.valid? parser.valid?
expect(parser.errors[:field_19]).to eql(["You must answer q12 - address"]) expect(parser.errors[:field_19]).to eql(["You must answer q12 - address lines 1 and 2"])
expect(parser.errors[:field_21]).to eql(["You must answer town or city"]) expect(parser.errors[:field_21]).to eql(["You must answer q12 - town or city"])
end end
end end
end end
@ -937,8 +937,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it "adds appropriate errors" do it "adds appropriate errors" do
expect(parser.errors[:field_18]).to eql(["You must answer UPRN"]) expect(parser.errors[:field_18]).to eql(["You must answer UPRN"])
expect(parser.errors[:field_19]).to eql(["You must answer q12 - address"]) expect(parser.errors[:field_19]).to eql(["You must answer q12 - address lines 1 and 2"])
expect(parser.errors[:field_21]).to eql(["You must answer town or city"]) expect(parser.errors[:field_21]).to eql(["You must answer q12 - town or city"])
end end
end end

Loading…
Cancel
Save