mapping_spec.rb 644 B

1234567891011121314151617181920212223242526272829
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Sequencer::Unit::Import::Ldap::User::Mapping, sequencer: :unit do
  4. it 'ensures to unset attribute value if none is provided' do
  5. ldap_config = {
  6. user_attributes: {
  7. firstName: 'firstname',
  8. lastName: 'lastname',
  9. samaccountname: 'login',
  10. }
  11. }
  12. resource = {
  13. samaccountname: 'Some41',
  14. firstName: 'Some',
  15. }
  16. provided = process(
  17. ldap_config: ldap_config,
  18. resource: resource,
  19. )
  20. expect(provided['lastname']).to be_nil
  21. end
  22. end