Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(integrations): Fix creating a deleted customer #2265

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(integration_customers:, customer:, new_customer:)
end

def call
return if integration_customers.nil?
return if integration_customers.nil? || customer.nil?

sanitize_integration_customers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@
end
end

context 'without customer' do
let(:integration_code) { integration.code }
let(:sync_with_provider) { true }
let(:external_customer_id) { nil }
let(:new_customer) { true }
let(:customer) { nil }

it 'does not call create job' do
expect { service_call }.not_to have_enqueued_job(IntegrationCustomers::CreateJob)
end

it 'does not call update job' do
expect { service_call }.not_to have_enqueued_job(IntegrationCustomers::UpdateJob)
end
end

context 'without external fields set' do
let(:integration_code) { integration.code }
let(:sync_with_provider) { false }
Expand Down