|
|
@ -237,12 +237,26 @@ RSpec.describe Validations::PropertyValidations do |
|
|
|
context "when the property has been let before" do |
|
|
|
context "when the property has been let before" do |
|
|
|
let(:non_temporary_previous_tenancies) do |
|
|
|
let(:non_temporary_previous_tenancies) do |
|
|
|
[ |
|
|
|
[ |
|
|
|
"Tied housing or rented with job", "Supported housing", "Sheltered accommodation", |
|
|
|
"Tied housing or rented with job", |
|
|
|
"Home Office Asylum Support", "Any other accommodation" |
|
|
|
"Supported housing", |
|
|
|
|
|
|
|
"Sheltered accommodation", |
|
|
|
|
|
|
|
"Home Office Asylum Support", |
|
|
|
|
|
|
|
"Any other accommodation", |
|
|
|
] |
|
|
|
] |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the previous tenancy was not temporary" do |
|
|
|
context "when the previous tenancy was not temporary" do |
|
|
|
|
|
|
|
let(:referral_sources) do |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
"Re-located through official housing mobility scheme", |
|
|
|
|
|
|
|
"Other social landlord", |
|
|
|
|
|
|
|
"Police, probation or prison", |
|
|
|
|
|
|
|
"Youth offending team", |
|
|
|
|
|
|
|
"Community mental health team", |
|
|
|
|
|
|
|
"Health service", |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "validates that the property is not being relet to tenant who occupied as temporary" do |
|
|
|
it "validates that the property is not being relet to tenant who occupied as temporary" do |
|
|
|
non_temporary_previous_tenancies.each do |rsn| |
|
|
|
non_temporary_previous_tenancies.each do |rsn| |
|
|
|
record.rsnvac = "Relet to tenant who occupied same property as temporary accommodation" |
|
|
|
record.rsnvac = "Relet to tenant who occupied same property as temporary accommodation" |
|
|
@ -253,15 +267,6 @@ RSpec.describe Validations::PropertyValidations do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
let(:referral_sources) do |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
"Re-located through official housing mobility scheme", |
|
|
|
|
|
|
|
"Other social landlord", "Police, probation or prison", |
|
|
|
|
|
|
|
"Youth offending team", "Community mental health team", |
|
|
|
|
|
|
|
"Health service" |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "validates that the letting source is not a referral" do |
|
|
|
it "validates that the letting source is not a referral" do |
|
|
|
referral_sources.each do |src| |
|
|
|
referral_sources.each do |src| |
|
|
|
record.rsnvac = "Relet to tenant who occupied same property as temporary accommodation" |
|
|
|
record.rsnvac = "Relet to tenant who occupied same property as temporary accommodation" |
|
|
|