Browse Source

feat: update tests

pull/1692/head
natdeanlewissoftwire 3 years ago
parent
commit
af7456fb23
  1. 3
      spec/models/form/lettings/subsections/property_information_spec.rb
  2. 6
      spec/services/imports/lettings_logs_import_service_spec.rb

3
spec/models/form/lettings/subsections/property_information_spec.rb

@ -58,8 +58,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
property_let_type property_let_type
property_vacancy_reason_not_first_let property_vacancy_reason_not_first_let
property_vacancy_reason_first_let property_vacancy_reason_first_let
property_number_of_times_relet_not_social_let property_number_of_times_relet
property_number_of_times_relet_social_let
property_unit_type property_unit_type
property_building_type property_building_type
property_wheelchair_accessible property_wheelchair_accessible

6
spec/services/imports/lettings_logs_import_service_spec.rb

@ -456,13 +456,13 @@ RSpec.describe Imports::LettingsLogsImportService do
end end
end end
context "and the number the property was relet is over 20" do context "and the number the property was relet is over 150" do
before do before do
lettings_log_xml.at_xpath("//xmlns:Q20").content = "25" lettings_log_xml.at_xpath("//xmlns:Q20").content = "155"
end end
it "intercepts the relevant validation error" do it "intercepts the relevant validation error" do
expect(logger).to receive(:warn).with(/Removing offered with error: Times previously offered since becoming available must be between 0 and 20/) expect(logger).to receive(:warn).with(/Removing offered with error: Times previously offered since becoming available must be between 0 and 150/)
expect { lettings_log_service.send(:create_log, lettings_log_xml) } expect { lettings_log_service.send(:create_log, lettings_log_xml) }
.not_to raise_error .not_to raise_error
end end

Loading…
Cancel
Save