|
|
|
|
@ -660,18 +660,28 @@ RSpec.describe Validations::Sales::SoftValidations do
|
|
|
|
|
describe "#grant_outside_common_range?" do |
|
|
|
|
it "returns true if grant is below 9000" do |
|
|
|
|
record.grant = 1_000 |
|
|
|
|
record.saledate = Time.zone.local(2024, 1, 1) |
|
|
|
|
|
|
|
|
|
expect(record).to be_grant_outside_common_range |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "returns true if grant is above 16000" do |
|
|
|
|
record.grant = 100_000 |
|
|
|
|
record.saledate = Time.zone.local(2024, 1, 1) |
|
|
|
|
|
|
|
|
|
expect(record).to be_grant_outside_common_range |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "returns false if grant is within expected range" do |
|
|
|
|
record.grant = 10_000 |
|
|
|
|
record.saledate = Time.zone.local(2024, 1, 1) |
|
|
|
|
|
|
|
|
|
expect(record).not_to be_grant_outside_common_range |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "returns false for logs after 2024" do |
|
|
|
|
record.grant = 100_000 |
|
|
|
|
record.saledate = Time.zone.local(2025, 1, 1) |
|
|
|
|
|
|
|
|
|
expect(record).not_to be_grant_outside_common_range |
|
|
|
|
end |
|
|
|
|
|