|
|
@ -481,7 +481,7 @@ RSpec.describe Imports::LettingsLogsFieldImportService do |
|
|
|
before do |
|
|
|
before do |
|
|
|
Imports::LettingsLogsImportService.new(storage_service, logger).create_logs(fixture_directory) |
|
|
|
Imports::LettingsLogsImportService.new(storage_service, logger).create_logs(fixture_directory) |
|
|
|
lettings_log_file.rewind |
|
|
|
lettings_log_file.rewind |
|
|
|
lettings_log.update!(reason: nil) |
|
|
|
lettings_log.update!(reason: nil, values_updated_at: nil) |
|
|
|
lettings_log_xml.at_xpath("//xmlns:Q9a").content = "47" |
|
|
|
lettings_log_xml.at_xpath("//xmlns:Q9a").content = "47" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -489,6 +489,7 @@ RSpec.describe Imports::LettingsLogsFieldImportService do |
|
|
|
expect(logger).to receive(:info).with(/lettings log \d+'s reason value has been set to 47/) |
|
|
|
expect(logger).to receive(:info).with(/lettings log \d+'s reason value has been set to 47/) |
|
|
|
expect { import_service.send(:update_reason, lettings_log_xml) } |
|
|
|
expect { import_service.send(:update_reason, lettings_log_xml) } |
|
|
|
.to(change { lettings_log.reload.reason }.from(nil).to(47)) |
|
|
|
.to(change { lettings_log.reload.reason }.from(nil).to(47)) |
|
|
|
|
|
|
|
expect(lettings_log.values_updated_at).not_to be_nil |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -498,7 +499,7 @@ RSpec.describe Imports::LettingsLogsFieldImportService do |
|
|
|
before do |
|
|
|
before do |
|
|
|
Imports::LettingsLogsImportService.new(storage_service, logger).create_logs(fixture_directory) |
|
|
|
Imports::LettingsLogsImportService.new(storage_service, logger).create_logs(fixture_directory) |
|
|
|
lettings_log_file.rewind |
|
|
|
lettings_log_file.rewind |
|
|
|
lettings_log.update!(reason: 18) |
|
|
|
lettings_log.update!(reason: 18, values_updated_at: nil) |
|
|
|
lettings_log_xml.at_xpath("//xmlns:Q9a").content = "47" |
|
|
|
lettings_log_xml.at_xpath("//xmlns:Q9a").content = "47" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -506,6 +507,7 @@ RSpec.describe Imports::LettingsLogsFieldImportService do |
|
|
|
expect(logger).to receive(:info).with(/lettings log \d+ has a value for reason, skipping update/) |
|
|
|
expect(logger).to receive(:info).with(/lettings log \d+ has a value for reason, skipping update/) |
|
|
|
expect { import_service.send(:update_reason, lettings_log_xml) } |
|
|
|
expect { import_service.send(:update_reason, lettings_log_xml) } |
|
|
|
.not_to(change { lettings_log.reload.reason }) |
|
|
|
.not_to(change { lettings_log.reload.reason }) |
|
|
|
|
|
|
|
expect(lettings_log.values_updated_at).to be_nil |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -515,7 +517,7 @@ RSpec.describe Imports::LettingsLogsFieldImportService do |
|
|
|
before do |
|
|
|
before do |
|
|
|
Imports::LettingsLogsImportService.new(storage_service, logger).create_logs(fixture_directory) |
|
|
|
Imports::LettingsLogsImportService.new(storage_service, logger).create_logs(fixture_directory) |
|
|
|
lettings_log_file.rewind |
|
|
|
lettings_log_file.rewind |
|
|
|
lettings_log.update!(reason: nil) |
|
|
|
lettings_log.update!(reason: nil, values_updated_at: nil) |
|
|
|
lettings_log_xml.at_xpath("//xmlns:Q9a").content = "20" |
|
|
|
lettings_log_xml.at_xpath("//xmlns:Q9a").content = "20" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -529,6 +531,7 @@ RSpec.describe Imports::LettingsLogsFieldImportService do |
|
|
|
expect(logger).to receive(:info).with(/lettings log \d+'s reasonother value has been set to other/) |
|
|
|
expect(logger).to receive(:info).with(/lettings log \d+'s reasonother value has been set to other/) |
|
|
|
expect { import_service.send(:update_reason, lettings_log_xml) } |
|
|
|
expect { import_service.send(:update_reason, lettings_log_xml) } |
|
|
|
.to(change { lettings_log.reload.reason }.from(nil).to(20)) |
|
|
|
.to(change { lettings_log.reload.reason }.from(nil).to(20)) |
|
|
|
|
|
|
|
expect(lettings_log.values_updated_at).not_to be_nil |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -537,6 +540,7 @@ RSpec.describe Imports::LettingsLogsFieldImportService do |
|
|
|
expect(logger).to receive(:info).with(/lettings log \d+'s reason is other but other reason is not provided, skipping update/) |
|
|
|
expect(logger).to receive(:info).with(/lettings log \d+'s reason is other but other reason is not provided, skipping update/) |
|
|
|
expect { import_service.send(:update_reason, lettings_log_xml) } |
|
|
|
expect { import_service.send(:update_reason, lettings_log_xml) } |
|
|
|
.not_to(change { lettings_log.reload.reason }) |
|
|
|
.not_to(change { lettings_log.reload.reason }) |
|
|
|
|
|
|
|
expect(lettings_log.values_updated_at).to be_nil |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|