From f3d1d615dad454c17ff365a15e2105b5e2ee18fe Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Thu, 8 Jun 2023 09:23:42 +0100 Subject: [PATCH] feat: setup to replicate failures to fix --- app/models/form.rb | 2 +- spec/factories/sales_log.rb | 8 ++++---- .../bulk_upload/lettings/year2022/row_parser_spec.rb | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/models/form.rb b/app/models/form.rb index 16c896e4c..b1a8802bd 100644 --- a/app/models/form.rb +++ b/app/models/form.rb @@ -9,7 +9,7 @@ class Form @end_date = if start_year && start_year.to_i > 2022 Time.zone.local(start_year + 1, 6, 9) else - Time.zone.local(start_year + 1, 8, 7) + Time.zone.local(start_year + 1, 6, 7) end @setup_sections = type == "sales" ? [Form::Sales::Sections::Setup.new(nil, nil, self)] : [Form::Lettings::Sections::Setup.new(nil, nil, self)] @form_sections = sections_in_form.map { |sec| sec.new(nil, nil, self) } diff --git a/spec/factories/sales_log.rb b/spec/factories/sales_log.rb index 905298e5e..619413f3a 100644 --- a/spec/factories/sales_log.rb +++ b/spec/factories/sales_log.rb @@ -2,14 +2,14 @@ FactoryBot.define do factory :sales_log do created_by { FactoryBot.create(:user) } owning_organisation { created_by.organisation } - created_at { Time.utc(2023, 2, 8, 16, 52, 15) } - updated_at { Time.utc(2023, 2, 8, 16, 52, 15) } + created_at { Time.zone.today } + updated_at { Time.zone.today } trait :in_progress do purchid { "PC123" } ownershipsch { 2 } type { 8 } jointpur { 2 } - saledate { Time.utc(2023, 2, 2, 10, 36, 49) } + saledate { Time.zone.today } end trait :shared_ownership do ownershipsch { 1 } @@ -39,7 +39,7 @@ FactoryBot.define do purchid { rand(999_999_999).to_s } ownershipsch { 2 } type { 8 } - saledate { Time.utc(2023, 2, 2, 10, 36, 49) } + saledate { Time.zone.today } jointpur { 1 } beds { 2 } jointmore { 1 } diff --git a/spec/services/bulk_upload/lettings/year2022/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2022/row_parser_spec.rb index bac02dde6..05120713d 100644 --- a/spec/services/bulk_upload/lettings/year2022/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2022/row_parser_spec.rb @@ -13,7 +13,7 @@ RSpec.describe BulkUpload::Lettings::Year2022::RowParser do let(:managing_org) { create(:organisation, :with_old_visible_id) } let(:scheme) { create(:scheme, :with_old_visible_id, owning_organisation: owning_org) } let(:location) { create(:location, :with_old_visible_id, scheme:) } - let(:mock_interrupion_ids) {} + let(:mock_interruption_ids) {} let(:setup_section_params) do { @@ -148,7 +148,7 @@ RSpec.describe BulkUpload::Lettings::Year2022::RowParser do end before do - mock_interrupion_ids + mock_interruption_ids create(:organisation_relationship, parent_organisation: owning_org, child_organisation: managing_org) end @@ -993,7 +993,7 @@ RSpec.describe BulkUpload::Lettings::Year2022::RowParser do context "when soft validation is triggered and the mappings for errors are not defined" do let(:attributes) { setup_section_params.merge({ field_12: 22, field_35: 5 }) } # rubocop:disable RSpec/AnyInstance - let(:mock_interrupion_ids) { allow_any_instance_of(Form::Page).to receive(:interruption_screen_question_ids).and_return(%w[fake_question_id]) } + let(:mock_interruption_ids) { allow_any_instance_of(Form::Page).to receive(:interruption_screen_question_ids).and_return(%w[fake_question_id]) } # rubocop:enable RSpec/AnyInstance it "does not crash" do