|
|
|
@ -267,6 +267,9 @@ RSpec.describe Validations::Sales::SoftValidations do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when validating extra borrowing" do |
|
|
|
context "when validating extra borrowing" do |
|
|
|
|
|
|
|
context "when the log is for 2023" do |
|
|
|
|
|
|
|
let(:record) { build(:sales_log, saledate: Time.zone.local(2023, 12, 1)) } |
|
|
|
|
|
|
|
|
|
|
|
it "returns false if extrabor not present" do |
|
|
|
it "returns false if extrabor not present" do |
|
|
|
record.mortgage = 50_000 |
|
|
|
record.mortgage = 50_000 |
|
|
|
record.deposit = 40_000 |
|
|
|
record.deposit = 40_000 |
|
|
|
@ -332,6 +335,21 @@ RSpec.describe Validations::Sales::SoftValidations do |
|
|
|
.to be_extra_borrowing_expected_but_not_reported |
|
|
|
.to be_extra_borrowing_expected_but_not_reported |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when the log is for 2024" do |
|
|
|
|
|
|
|
let(:record) { build(:sales_log, saledate: Time.zone.local(2024, 12, 1)) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "returns false for logs from 2024 onwards" do |
|
|
|
|
|
|
|
record.extrabor = 2 |
|
|
|
|
|
|
|
record.mortgage = 50_000 |
|
|
|
|
|
|
|
record.deposit = 40_000 |
|
|
|
|
|
|
|
record.value = 100_000 |
|
|
|
|
|
|
|
record.discount = 11 |
|
|
|
|
|
|
|
expect(record) |
|
|
|
|
|
|
|
.not_to be_extra_borrowing_expected_but_not_reported |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
describe "savings amount validations" do |
|
|
|
describe "savings amount validations" do |
|
|
|
|