trigger_spec.rb 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. require 'rails_helper'
  2. RSpec.describe 'Manage > Trigger', type: :system do
  3. context 'Selector' do
  4. context 'custom attribute', db_strategy: :reset do
  5. it 'enables selection of multiple values for select attribute' do
  6. attribute = create_attribute :object_manager_attribute_select,
  7. data_option: {
  8. options: {
  9. 'name 1': 'name 1',
  10. 'name 2': 'name 2',
  11. },
  12. default: '',
  13. null: false,
  14. relation: '',
  15. maxlength: 255,
  16. nulloption: true,
  17. }
  18. visit '/#manage/trigger'
  19. click '.page-header-meta .btn--success'
  20. modal_ready
  21. within '.modal .ticket_selector' do
  22. find('.js-attributeSelector select').select(attribute.display)
  23. expect(find('.js-value select')).to be_multiple
  24. end
  25. end
  26. end
  27. end
  28. context 'Perform' do
  29. context 'Tags' do
  30. it 'shows tag selection list in foreground' do
  31. tag_item = create :tag_item
  32. visit '/#manage/trigger'
  33. click '.page-header-meta .btn--success'
  34. modal_ready
  35. within '.modal .ticket_perform_action' do
  36. find('.js-attributeSelector select').select('Tags')
  37. input = find('.js-value .token-input')
  38. input.fill_in with: tag_item.name.slice(0, 3)
  39. end
  40. expect(page).to have_css('.ui-autocomplete.ui-widget-content') { |elem| !elem.obscured? }
  41. end
  42. end
  43. end
  44. end