Browse Source

CLDC-3499: Lint

CLDC-3499-remove-pre-2025-tests
samyou-softwire 2 weeks ago
parent
commit
fd10147e14
  1. 2
      spec/components/check_answers_summary_list_card_component_spec.rb
  2. 2
      spec/features/form/validations_spec.rb
  3. 12
      spec/models/lettings_log_spec.rb
  4. 2
      spec/models/validations/setup_validations_spec.rb
  5. 15
      spec/requests/sales_logs_controller_spec.rb

2
spec/components/check_answers_summary_list_card_component_spec.rb

@ -1,8 +1,6 @@
require "rails_helper" require "rails_helper"
RSpec.describe CheckAnswersSummaryListCardComponent, type: :component do RSpec.describe CheckAnswersSummaryListCardComponent, type: :component do
include CollectionTimeHelper
subject(:component) { described_class.new(questions:, log:, user:) } subject(:component) { described_class.new(questions:, log:, user:) }
let(:rendered) { render_inline(component) } let(:rendered) { render_inline(component) }

2
spec/features/form/validations_spec.rb

@ -11,7 +11,7 @@ RSpec.describe "validations" do
renewal: 0, renewal: 0,
first_time_property_let_as_social_housing: 0, first_time_property_let_as_social_housing: 0,
unitletas: 1, unitletas: 1,
rsnvac: 9 rsnvac: 9,
) )
end end
let(:id) { lettings_log.id } let(:id) { lettings_log.id }

12
spec/models/lettings_log_spec.rb

@ -1972,8 +1972,8 @@ RSpec.describe LettingsLog do
it "returns the log as a duplicate" do it "returns the log as a duplicate" do
expect(duplicate_sets).to contain_exactly( expect(duplicate_sets).to contain_exactly(
match_array([log.id, duplicate_log.id]), contain_exactly(log.id, duplicate_log.id),
match_array([duplicate_supported_housing_log.id, supported_housing_log.id]), contain_exactly(duplicate_supported_housing_log.id, supported_housing_log.id),
) )
end 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) 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) 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( expect(duplicate_sets).to contain_exactly(
match_array([log.id, duplicate_log.id]), contain_exactly(log.id, duplicate_log.id),
match_array([supported_housing_log.id, duplicate_supported_housing_log.id]), contain_exactly(supported_housing_log.id, duplicate_supported_housing_log.id),
) )
end 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) 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) 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( expect(duplicate_sets).to contain_exactly(
match_array([log.id, duplicate_log.id]), contain_exactly(log.id, duplicate_log.id),
match_array([supported_housing_log.id, duplicate_supported_housing_log.id]), contain_exactly(supported_housing_log.id, duplicate_supported_housing_log.id),
) )
end end

2
spec/models/validations/setup_validations_spec.rb

@ -103,7 +103,7 @@ RSpec.describe Validations::SetupValidations do
end end
it "adds an error to startdate" do 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) setup_validator.validate_startdate_setup(record)
expect(record.errors["startdate"]).to include(match I18n.t("validations.lettings.setup.startdate.not_within.next_two_weeks")) expect(record.errors["startdate"]).to include(match I18n.t("validations.lettings.setup.startdate.not_within.next_two_weeks"))
end end

15
spec/requests/sales_logs_controller_spec.rb

@ -93,21 +93,22 @@ RSpec.describe SalesLogsController, type: :request do
[ [
"beds", "beds",
[ [
"Number of bedrooms must be 1 if the property is a bedsit." "Number of bedrooms must be 1 if the property is a bedsit.",
] ],
], ],
[ [
"proptype", "proptype",
[ [
"Answer cannot be 'Bedsit' if the property has 2 or more bedrooms." "Answer cannot be 'Bedsit' if the property has 2 or more bedrooms.",
] ],
], ],
[ [
"saledate", "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}." "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 end
end end

Loading…
Cancel
Save