checkbox_spec.rb 988 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. require 'lib/import/otrs/dynamic_field_examples'
  4. RSpec.describe Import::OTRS::DynamicField::Checkbox do
  5. it_behaves_like 'Import::OTRS::DynamicField'
  6. it 'imports an OTRS Checkbox DynamicField' do
  7. zammad_structure = {
  8. object: 'Ticket',
  9. name: 'checkbox_example',
  10. display: 'Checkbox Example',
  11. screens: {
  12. view: {
  13. '-all-' => {
  14. shown: true
  15. }
  16. }
  17. },
  18. active: true,
  19. editable: true,
  20. position: '26',
  21. created_by_id: 1,
  22. updated_by_id: 1,
  23. data_type: 'boolean',
  24. data_option: {
  25. default: true,
  26. options: {
  27. true => 'Yes',
  28. false => 'No'
  29. },
  30. null: true,
  31. translate: true
  32. }
  33. }
  34. dynamic_field_from_json('checkbox/default', zammad_structure)
  35. end
  36. end