|
|
@ -396,14 +396,24 @@ RSpec.describe BulkUpload::Lettings::RowParser do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when 4 ie referred by LA and is general needs" do |
|
|
|
context "when 4 ie referred by LA and is general needs and owning org is LA" do |
|
|
|
let(:attributes) { { bulk_upload:, field_78: "4" } } |
|
|
|
let(:attributes) { { bulk_upload:, field_78: "4", field_111: owning_org.old_visible_id.to_s } } |
|
|
|
|
|
|
|
|
|
|
|
it "is not permitted" do |
|
|
|
it "is not permitted" do |
|
|
|
expect(parser.errors[:field_78]).to be_present |
|
|
|
expect(parser.errors[:field_78]).to be_present |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when 4 ie referred by LA and is general needs and owning org is PRP" do |
|
|
|
|
|
|
|
let(:owning_org) { create(:organisation, :prp, :with_old_visible_id) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let(:attributes) { { bulk_upload:, field_78: "4", field_111: owning_org.old_visible_id.to_s } } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "is permitted" do |
|
|
|
|
|
|
|
expect(parser.errors[:field_78]).to be_blank |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when 4 ie referred by LA and is not general needs" do |
|
|
|
context "when 4 ie referred by LA and is not general needs" do |
|
|
|
let(:bulk_upload) { create(:bulk_upload, :lettings, user:, needstype: 2) } |
|
|
|
let(:bulk_upload) { create(:bulk_upload, :lettings, user:, needstype: 2) } |
|
|
|
let(:attributes) { { bulk_upload:, field_78: "4" } } |
|
|
|
let(:attributes) { { bulk_upload:, field_78: "4" } } |
|
|
|