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::Checkbox do
|
|
|
|
it_behaves_like 'Import::OTRS::DynamicField'
|
|
|
|
|
|
|
|
it 'imports an OTRS Checkbox DynamicField' do
|
|
|
|
|
|
|
|
zammad_structure = {
|
2018-12-19 17:31:51 +00:00
|
|
|
object: 'Ticket',
|
|
|
|
name: 'checkbox_example',
|
|
|
|
display: 'Checkbox Example',
|
|
|
|
screens: {
|
2016-11-25 16:10:37 +00:00
|
|
|
view: {
|
|
|
|
'-all-' => {
|
|
|
|
shown: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
active: true,
|
|
|
|
editable: true,
|
|
|
|
position: '26',
|
2016-11-25 16:10:37 +00:00
|
|
|
created_by_id: 1,
|
|
|
|
updated_by_id: 1,
|
2018-12-19 17:31:51 +00:00
|
|
|
data_type: 'boolean',
|
|
|
|
data_option: {
|
|
|
|
default: true,
|
|
|
|
options: {
|
|
|
|
true => 'Yes',
|
2016-11-25 16:10:37 +00:00
|
|
|
false => 'No'
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
null: true,
|
2016-11-25 16:10:37 +00:00
|
|
|
translate: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dynamic_field_from_json('checkbox/default', zammad_structure)
|
|
|
|
end
|
|
|
|
end
|