dynamic_field_factory_spec.rb 770 B

123456789101112131415161718192021222324
  1. require 'rails_helper'
  2. require 'import/factory_examples'
  3. require 'import/otrs/dynamic_field_examples'
  4. RSpec.describe Import::OTRS::DynamicFieldFactory do
  5. it_behaves_like 'Import::Factory'
  6. let(:start_import_test) { described_class.import(object_structure) }
  7. let(:object_structure) { [load_dynamic_field_json('text/default')] }
  8. it 'responds to skip_field?' do
  9. expect(described_class).to respond_to('skip_field?')
  10. end
  11. it 'skips fields that have unsupported types' do
  12. described_class.import([load_dynamic_field_json('unsupported/master_slave')])
  13. expect(described_class.skip_field?('MasterSlave')).to be true
  14. end
  15. it 'imports OTRS DynamicFields' do
  16. expect(Import::OTRS::DynamicField::Text).to receive(:new)
  17. start_import_test
  18. end
  19. end