|
|
|
@ -418,6 +418,29 @@ RSpec.describe Imports::LettingsLogsImportService do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "and income over the max" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
lettings_log_xml.at_xpath("//xmlns:Q8Money").content = "25000" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "intercepts the relevant validation error" do |
|
|
|
|
|
|
|
expect(logger).to receive(:warn).with(/Removing working situation because income is too high for it/) |
|
|
|
|
|
|
|
expect { lettings_log_service.send(:create_log, lettings_log_xml) } |
|
|
|
|
|
|
|
.not_to raise_error |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "clears out the referral answer" do |
|
|
|
|
|
|
|
allow(logger).to receive(:warn) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lettings_log_service.send(:create_log, lettings_log_xml) |
|
|
|
|
|
|
|
lettings_log = LettingsLog.find_by(old_id: lettings_log_id) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(lettings_log).not_to be_nil |
|
|
|
|
|
|
|
expect(lettings_log.ecstat1).to be_nil |
|
|
|
|
|
|
|
expect(lettings_log.earnings).to eq(25_000) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "and the net income soft validation is triggered (net_income_value_check)" do |
|
|
|
context "and the net income soft validation is triggered (net_income_value_check)" do |
|
|
|
before do |
|
|
|
before do |
|
|
|
lettings_log_xml.at_xpath("//xmlns:Q8a").content = "1 Weekly" |
|
|
|
lettings_log_xml.at_xpath("//xmlns:Q8a").content = "1 Weekly" |
|
|
|
|