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::Multiselect do
|
|
|
|
it_behaves_like 'Import::OTRS::DynamicField'
|
|
|
|
|
|
|
|
it 'imports an OTRS Multiselect DynamicField' do
|
|
|
|
|
|
|
|
zammad_structure = {
|
2018-12-19 17:31:51 +00:00
|
|
|
object: 'Ticket',
|
|
|
|
name: 'multiselect_example',
|
|
|
|
display: 'Multiselec tExample',
|
|
|
|
screens: {
|
2016-11-25 16:10:37 +00:00
|
|
|
view: {
|
|
|
|
'-all-' => {
|
|
|
|
shown: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
active: true,
|
|
|
|
editable: true,
|
|
|
|
position: '4',
|
|
|
|
created_by_id: 1,
|
|
|
|
updated_by_id: 1,
|
|
|
|
data_type: 'select',
|
|
|
|
data_option: {
|
2018-12-19 17:31:51 +00:00
|
|
|
default: '',
|
|
|
|
multiple: true,
|
|
|
|
options: {
|
2016-11-25 16:10:37 +00:00
|
|
|
'Hamburg' => 'Hamburg',
|
|
|
|
'München' => 'München',
|
|
|
|
'Köln' => 'Köln',
|
|
|
|
'Berlin' => 'Berlin'
|
|
|
|
},
|
2017-08-23 14:41:01 +00:00
|
|
|
nulloption: false,
|
|
|
|
null: true,
|
|
|
|
translate: false
|
2016-11-25 16:10:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dynamic_field_from_json('multiselect/default', zammad_structure)
|
|
|
|
end
|
|
|
|
end
|