dynamic_field_examples.rb 600 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. def dynamic_field_from_json(file, zammad_structure)
  4. expect(ObjectManager::Attribute).to receive(:add).with(zammad_structure)
  5. expect(ObjectManager::Attribute).to receive(:migration_execute)
  6. described_class.new(load_dynamic_field_json(file))
  7. end
  8. def load_dynamic_field_json(file)
  9. json_fixture("import/otrs/dynamic_field/#{file}")
  10. end
  11. RSpec.shared_examples 'Import::OTRS::DynamicField' do
  12. it 'responds to convert_name' do
  13. expect(described_class).to respond_to('convert_name')
  14. end
  15. end