Follow up - 8790e389be - Fixes issue #865 - Freshdesk import - Import last login date as such and not as image source.

This commit is contained in:
Thorsten Eckel 2021-05-26 17:15:58 +02:00
parent 85856cbd40
commit 77619212d6
2 changed files with 15 additions and 14 deletions

View file

@ -14,15 +14,15 @@ class Sequencer
provide_mapped do
{
login: contact['email'],
firstname: contact['name'],
email: contact['email'],
phone: contact['phone'],
active: contact['active'],
group_ids: group_ids,
password: password,
image_source: contact['last_login_at'],
role_ids: ::Role.where(name: role_names).pluck(:id),
login: contact['email'],
firstname: contact['name'],
email: contact['email'],
phone: contact['phone'],
active: contact['active'],
group_ids: group_ids,
password: password,
last_login: contact['last_login_at'],
role_ids: ::Role.where(name: role_names).pluck(:id),
}
end
end

View file

@ -60,11 +60,12 @@ RSpec.describe ::Sequencer::Sequence::Import::Freshdesk::Agent, sequencer: :sequ
it 'imports user correctly' do # rubocop:disable RSpec/MultipleExpectations, RSpec/ExampleLength
expect { process(process_payload) }.to change(User, :count).by(1)
expect(User.last).to have_attributes(
firstname: 'John',
lastname: 'Doe',
login: 'freshdesk@example.com',
email: 'freshdesk@example.com',
active: true,
firstname: 'John',
lastname: 'Doe',
login: 'freshdesk@example.com',
email: 'freshdesk@example.com',
active: true,
last_login: DateTime.parse('2021-05-10T07:52:58Z'),
)
end