Browse Source

Refactoring

pull/2509/head
Rachael Booth 2 years ago
parent
commit
bbc8cc82b5
  1. 2
      spec/models/validations/sales/financial_validations_spec.rb
  2. 15
      spec/support/bulk_upload/lettings_log_to_csv.rb

2
spec/models/validations/sales/financial_validations_spec.rb

@ -320,7 +320,6 @@ RSpec.describe Validations::Sales::FinancialValidations do
end end
context "when buyer 2 is a child" do context "when buyer 2 is a child" do
context "and saledate is current" do
let(:record) { build(:sales_log, :saledate_today, ecstat2: 9) } let(:record) { build(:sales_log, :saledate_today, ecstat2: 9) }
it "does not add an error if buyer 2 has no income" do it "does not add an error if buyer 2 has no income" do
@ -337,7 +336,6 @@ RSpec.describe Validations::Sales::FinancialValidations do
end end
end end
end end
end
describe "#validate_equity_in_range_for_year_and_type" do describe "#validate_equity_in_range_for_year_and_type" do
let(:record) { FactoryBot.build(:sales_log, saledate:) } let(:record) { FactoryBot.build(:sales_log, saledate:) }

15
spec/support/bulk_upload/lettings_log_to_csv.rb

@ -477,20 +477,7 @@ private
end end
def rent_type def rent_type
case log.rent_type LettingsLog::RENTTYPE_DETAIL_MAPPING[log.rent_type]
when LettingsLog::RENT_TYPE[:social_rent]
1
when LettingsLog::RENT_TYPE[:affordable_rent]
2
when LettingsLog::RENT_TYPE[:london_affordable_rent]
3
when LettingsLog::RENT_TYPE[:rent_to_buy]
4
when LettingsLog::RENT_TYPE[:london_living_rent]
5
when LettingsLog::RENT_TYPE[:other_intermediate_rent_product]
6
end
end end
def leftreg def leftreg

Loading…
Cancel
Save