2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2016-11-25 16:10:37 +00:00
|
|
|
require 'rails_helper'
|
2017-03-27 09:25:45 +00:00
|
|
|
require 'lib/import/otrs/dynamic_field_examples'
|
2016-11-25 16:10:37 +00:00
|
|
|
|
|
|
|
RSpec.describe Import::OTRS::DynamicField do
|
|
|
|
let(:object_structure) { load_dynamic_field_json('text/default') }
|
2019-04-15 01:41:17 +00:00
|
|
|
let(:start_import_test) { described_class.new(object_structure) }
|
|
|
|
|
|
|
|
it_behaves_like 'Import::OTRS::DynamicField'
|
2016-11-25 16:10:37 +00:00
|
|
|
|
|
|
|
it 'requires an implementation of init_callback' do
|
2020-10-22 13:57:01 +00:00
|
|
|
allow(ObjectManager::Attribute).to receive(:get).and_return(false)
|
2017-10-01 12:25:52 +00:00
|
|
|
expect do
|
2016-11-25 16:10:37 +00:00
|
|
|
start_import_test
|
2017-10-01 12:25:52 +00:00
|
|
|
end.to raise_error(RuntimeError)
|
2016-11-25 16:10:37 +00:00
|
|
|
end
|
|
|
|
end
|