diff --git a/spec/components/check_answers_summary_list_card_component_spec.rb b/spec/components/check_answers_summary_list_card_component_spec.rb index 68364542b..189548098 100644 --- a/spec/components/check_answers_summary_list_card_component_spec.rb +++ b/spec/components/check_answers_summary_list_card_component_spec.rb @@ -1,8 +1,6 @@ require "rails_helper" RSpec.describe CheckAnswersSummaryListCardComponent, type: :component do - include CollectionTimeHelper - subject(:component) { described_class.new(questions:, log:, user:) } let(:rendered) { render_inline(component) } diff --git a/spec/features/form/validations_spec.rb b/spec/features/form/validations_spec.rb index affa10952..8aa103d0c 100644 --- a/spec/features/form/validations_spec.rb +++ b/spec/features/form/validations_spec.rb @@ -11,7 +11,7 @@ RSpec.describe "validations" do renewal: 0, first_time_property_let_as_social_housing: 0, unitletas: 1, - rsnvac: 9 + rsnvac: 9, ) end let(:id) { lettings_log.id } diff --git a/spec/models/lettings_log_spec.rb b/spec/models/lettings_log_spec.rb index fde7fcbda..f69317832 100644 --- a/spec/models/lettings_log_spec.rb +++ b/spec/models/lettings_log_spec.rb @@ -1972,8 +1972,8 @@ RSpec.describe LettingsLog do it "returns the log as a duplicate" do expect(duplicate_sets).to contain_exactly( - match_array([log.id, duplicate_log.id]), - match_array([duplicate_supported_housing_log.id, supported_housing_log.id]), + contain_exactly(log.id, duplicate_log.id), + contain_exactly(duplicate_supported_housing_log.id, supported_housing_log.id), ) end @@ -1981,8 +1981,8 @@ RSpec.describe LettingsLog do supported_housing_log.update!(household_charge: 1, supcharg: nil, brent: nil, scharge: nil, pscharge: nil, tcharge: nil, owning_organisation: organisation) duplicate_supported_housing_log.update!(household_charge: 1, supcharg: nil, brent: nil, scharge: nil, pscharge: nil, tcharge: nil, owning_organisation: organisation) expect(duplicate_sets).to contain_exactly( - match_array([log.id, duplicate_log.id]), - match_array([supported_housing_log.id, duplicate_supported_housing_log.id]), + contain_exactly(log.id, duplicate_log.id), + contain_exactly(supported_housing_log.id, duplicate_supported_housing_log.id), ) end @@ -1998,8 +1998,8 @@ RSpec.describe LettingsLog do supported_housing_log.update!(is_carehome: 1, chcharge: 100, supcharg: nil, brent: nil, scharge: nil, pscharge: nil, tcharge: nil, owning_organisation: organisation) duplicate_supported_housing_log.update!(is_carehome: 1, chcharge: 100, supcharg: nil, brent: nil, scharge: nil, pscharge: nil, tcharge: nil, owning_organisation: organisation) expect(duplicate_sets).to contain_exactly( - match_array([log.id, duplicate_log.id]), - match_array([supported_housing_log.id, duplicate_supported_housing_log.id]), + contain_exactly(log.id, duplicate_log.id), + contain_exactly(supported_housing_log.id, duplicate_supported_housing_log.id), ) end diff --git a/spec/models/validations/setup_validations_spec.rb b/spec/models/validations/setup_validations_spec.rb index 93a247954..3925f5c04 100644 --- a/spec/models/validations/setup_validations_spec.rb +++ b/spec/models/validations/setup_validations_spec.rb @@ -103,7 +103,7 @@ RSpec.describe Validations::SetupValidations do end it "adds an error to startdate" do - record.startdate = Time.now + 15.days + record.startdate = Time.zone.now + 15.days setup_validator.validate_startdate_setup(record) expect(record.errors["startdate"]).to include(match I18n.t("validations.lettings.setup.startdate.not_within.next_two_weeks")) end diff --git a/spec/models/validations/soft_validations_spec.rb b/spec/models/validations/soft_validations_spec.rb index b186277bd..e2c2b897e 100644 --- a/spec/models/validations/soft_validations_spec.rb +++ b/spec/models/validations/soft_validations_spec.rb @@ -505,7 +505,7 @@ RSpec.describe Validations::SoftValidations do context "when the major repairs date is within 10 years of the tenancy start date" do it "shows the interruption screen" do record.startdate = current_collection_start_date - record.mrcdate = current_collection_start_date- 9.years + record.mrcdate = current_collection_start_date - 9.years expect(record.major_repairs_date_in_soft_range?).to be true end end @@ -513,7 +513,7 @@ RSpec.describe Validations::SoftValidations do context "when the major repairs date is less than 2 years before the tenancy start date" do it "does not show the interruption screen" do record.startdate = current_collection_start_date - record.mrcdate = current_collection_start_date- 1.year + record.mrcdate = current_collection_start_date - 1.year expect(record.major_repairs_date_in_soft_range?).to be false end end diff --git a/spec/requests/sales_logs_controller_spec.rb b/spec/requests/sales_logs_controller_spec.rb index 62167cf1a..cd731c799 100644 --- a/spec/requests/sales_logs_controller_spec.rb +++ b/spec/requests/sales_logs_controller_spec.rb @@ -90,24 +90,25 @@ RSpec.describe SalesLogsController, type: :request do json_response = JSON.parse(response.body) expect(response).to have_http_status(:unprocessable_content) expect(json_response["errors"]).to contain_exactly( - [ - "beds", - [ - "Number of bedrooms must be 1 if the property is a bedsit." - ] - ], - [ - "proptype", - [ - "Answer cannot be 'Bedsit' if the property has 2 or more bedrooms." - ] - ], - [ - "saledate", - [ - "Enter a date within the #{previous_collection_start_year} to #{previous_collection_end_year} or #{current_collection_start_year} to #{current_collection_end_year} collection years, which is between 1st April #{previous_collection_start_year} and 31st March #{current_collection_end_year}." - ] - ]) + [ + "beds", + [ + "Number of bedrooms must be 1 if the property is a bedsit.", + ], + ], + [ + "proptype", + [ + "Answer cannot be 'Bedsit' if the property has 2 or more bedrooms.", + ], + ], + [ + "saledate", + [ + "Enter a date within the #{previous_collection_start_year} to #{previous_collection_end_year} or #{current_collection_start_year} to #{current_collection_end_year} collection years, which is between 1st April #{previous_collection_start_year} and 31st March #{current_collection_end_year}.", + ], + ], + ) end end end