Browse Source

BU unrelated created_by user now a setup error

pull/1603/head
Phil Lee 2 years ago
parent
commit
5345e290aa
  1. 2
      app/services/bulk_upload/sales/year2023/row_parser.rb
  2. 4
      spec/services/bulk_upload/sales/year2023/row_parser_spec.rb

2
app/services/bulk_upload/sales/year2023/row_parser.rb

@ -1040,7 +1040,7 @@ private
unless created_by.organisation == owning_organisation unless created_by.organisation == owning_organisation
block_log_creation! block_log_creation!
errors.add(:field_2, "User must be related to owning organisation") errors.add(:field_2, "User must be related to owning organisation", category: :setup)
end end
end end

4
spec/services/bulk_upload/sales/year2023/row_parser_spec.rb

@ -372,8 +372,8 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do
let(:attributes) { { bulk_upload:, field_1: owning_org.old_visible_id, field_2: other_user.email } } let(:attributes) { { bulk_upload:, field_1: owning_org.old_visible_id, field_2: other_user.email } }
it "is not permitted" do it "is not permitted as a setup error" do
expect(parser.errors[:field_2]).to be_present expect(parser.errors.where(:field_2, category: :setup)).to be_present
end end
it "blocks log creation" do it "blocks log creation" do

Loading…
Cancel
Save