@ -1390,6 +1390,32 @@ RSpec.describe BulkUpload::Lettings::Year2022::RowParser do
it " assigns the correct location " do
expect ( parser . log . location ) . to eql ( location )
end
context " when location had leading zeroes in its id in Old CORE " do
let ( :attributes ) { { bulk_upload : , field_4 : scheme . old_visible_id , field_5 : " 123 " , field_111 : owning_org . old_visible_id , field_113 : owning_org . old_visible_id } }
before do
location . old_visible_id = " 00123 "
location . save!
end
it " assigns the correct location " do
expect ( parser . log . location ) . to eql ( location )
end
end
context " when the user provides an id with leading zeroes " do
let ( :attributes ) { { bulk_upload : , field_4 : scheme . old_visible_id , field_5 : " 00123 " , field_111 : owning_org . old_visible_id , field_113 : owning_org . old_visible_id } }
before do
location . old_visible_id = " 123 "
location . save!
end
it " assigns the correct location " do
expect ( parser . log . location ) . to eql ( location )
end
end
end
end
@ -1408,6 +1434,32 @@ RSpec.describe BulkUpload::Lettings::Year2022::RowParser do
it " assigns the correct scheme " do
expect ( parser . log . scheme ) . to eql ( scheme )
end
context " when scheme had leading zeroes in its id in Old CORE " do
let ( :attributes ) { { bulk_upload : , field_4 : " 10 " , field_5 : location . old_visible_id , field_111 : owning_org . old_visible_id , field_113 : owning_org . old_visible_id } }
before do
scheme . old_visible_id = " 010 "
scheme . save!
end
it " assigns the correct scheme " do
expect ( parser . log . scheme ) . to eql ( scheme )
end
end
context " when the user provides an id with leading zeroes " do
let ( :attributes ) { { bulk_upload : , field_4 : " 010 " , field_5 : location . old_visible_id , field_111 : owning_org . old_visible_id , field_113 : owning_org . old_visible_id } }
before do
scheme . old_visible_id = " 10 "
scheme . save!
end
it " assigns the correct scheme " do
expect ( parser . log . scheme ) . to eql ( scheme )
end
end
end
end