Fixes #4051 - Freshdesk-Migration does not like no Companies / Organisations within the source.
This commit is contained in:
parent
92d19a6221
commit
cbf22c332d
2 changed files with 11 additions and 1 deletions
|
@ -29,7 +29,7 @@ class Sequencer
|
||||||
private
|
private
|
||||||
|
|
||||||
def organization_id
|
def organization_id
|
||||||
id_map['Organization'][resource['company_id']]
|
id_map.dig('Organization', resource['company_id'])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -104,5 +104,15 @@ RSpec.describe ::Sequencer::Sequence::Import::Freshdesk::Contact, sequencer: :se
|
||||||
expect(User.last).to have_attributes(imported_user)
|
expect(User.last).to have_attributes(imported_user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'without organizations' do
|
||||||
|
let(:id_map) do
|
||||||
|
{}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'imports customer correctly (increased user count)' do
|
||||||
|
expect { process(process_payload) }.to change(User, :count).by(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue