@ -2047,10 +2086,33 @@ RSpec.describe LettingsLog do
startdate:Time.zone.tomorrow,
startdate:Time.zone.tomorrow,
voiddate:Time.zone.today,
voiddate:Time.zone.today,
mrcdate:Time.zone.today,
mrcdate:Time.zone.today,
rent_type:2,
needstype:2,
period:1,
beds:1,
brent:7.17,
scharge:1,
pscharge:1,
supcharg:1,
created_by:created_by_user,
unresolved:nil,
unresolved:nil,
)
)
end
end
beforedo
LaRentRange.create!(
ranges_rent_id:"1",
la:"E07000223",
beds:0,
lettype:8,
soft_min:12.41,
soft_max:89.54,
hard_min:10.87,
hard_max:100.99,
start_year:lettings_log.startdate.year,
)
end
context"and the new startdate triggers void date validation"do
context"and the new startdate triggers void date validation"do
it"doesn't clear void date value"do
it"doesn't clear void date value"do
expect{lettings_log.update!(startdate:Time.zone.yesterday)}.toraise_error(ActiveRecord::RecordInvalid,/Enter a void date that is before the tenancy start date/)
expect{lettings_log.update!(startdate:Time.zone.yesterday)}.toraise_error(ActiveRecord::RecordInvalid,/Enter a void date that is before the tenancy start date/)
@ -2066,6 +2128,16 @@ RSpec.describe LettingsLog do