Working on issue #689 - User root@localhost gets imported but should not.
This commit is contained in:
parent
7562cd2dff
commit
5a6e824c3a
2 changed files with 16 additions and 0 deletions
|
@ -2,6 +2,14 @@ module Import
|
||||||
module OTRS
|
module OTRS
|
||||||
module UserFactory
|
module UserFactory
|
||||||
extend Import::Factory
|
extend Import::Factory
|
||||||
|
|
||||||
|
# rubocop:disable Style/ModuleFunction
|
||||||
|
extend self
|
||||||
|
|
||||||
|
# skip root@localhost since we have our own \o/
|
||||||
|
def skip?(record, *_args)
|
||||||
|
record['UserID'].to_i == 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,4 +3,12 @@ require 'import/factory_examples'
|
||||||
|
|
||||||
RSpec.describe Import::OTRS::UserFactory do
|
RSpec.describe Import::OTRS::UserFactory do
|
||||||
it_behaves_like 'Import::Factory'
|
it_behaves_like 'Import::Factory'
|
||||||
|
|
||||||
|
it 'skips root@localhost' do
|
||||||
|
|
||||||
|
root_data = json_fixture('import/otrs/user/default')
|
||||||
|
expect(Import::OTRS::User).to_not receive(:new)
|
||||||
|
|
||||||
|
described_class.import([root_data])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue