Browse Source

extract old_visible_id in factory to trait

remotes/origin/bulk-upload-errors-integration
Phil Lee 3 years ago
parent
commit
b9e5f927cf
  1. 3
      spec/factories/organisation.rb
  2. 2
      spec/services/bulk_upload/processor_spec.rb

3
spec/factories/organisation.rb

@ -9,8 +9,11 @@ FactoryBot.define do
created_at { Time.zone.now } created_at { Time.zone.now }
updated_at { Time.zone.now } updated_at { Time.zone.now }
holds_own_stock { true } holds_own_stock { true }
trait :with_old_visible_id do
old_visible_id { rand(9_999_999).to_s } old_visible_id { rand(9_999_999).to_s }
end end
end
factory :organisation_rent_period do factory :organisation_rent_period do
organisation organisation

2
spec/services/bulk_upload/processor_spec.rb

@ -19,7 +19,7 @@ RSpec.describe BulkUpload::Processor do
it "persist the validation errors" do it "persist the validation errors" do
allow(BulkUpload::Downloader).to receive(:new).with(bulk_upload:).and_return(mock_downloader) allow(BulkUpload::Downloader).to receive(:new).with(bulk_upload:).and_return(mock_downloader)
expect { processor.call }.to change(BulkUploadError, :count).by(10) expect { processor.call }.to change(BulkUploadError, :count).by(8)
end end
it "deletes the local file afterwards" do it "deletes the local file afterwards" do

Loading…
Cancel
Save