issue_4848_fix_overview_bulk_screen_spec.rb 1.1 KB

1234567891011121314151617181920212223242526272829
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Issue4848FixOverviewBulkScreen, type: :db_migration do
  4. context 'when having pre-tenant setting' do
  5. before do
  6. ObjectManager::Attribute.for_object('Ticket').where(name: %w[state_id pending_time group_id owner_id priority_id]).each do |field|
  7. field.screens.delete(:overview_bulk)
  8. field.save!
  9. end
  10. end
  11. it 'checks changes for group_id' do
  12. migrate
  13. expect(ObjectManager::Attribute.for_object('Ticket').find_by(name: 'group_id').screens[:overview_bulk]['ticket.agent'][:direction]).to eq('up')
  14. end
  15. it 'checks changes for pending_time' do
  16. migrate
  17. expect(ObjectManager::Attribute.for_object('Ticket').find_by(name: 'pending_time').screens[:overview_bulk]['ticket.agent'][:orientation]).to eq('top')
  18. end
  19. it 'checks changes for state_id' do
  20. migrate
  21. expect(ObjectManager::Attribute.for_object('Ticket').find_by(name: 'state_id').screens[:overview_bulk]['ticket.agent'][:filter]).to eq(Ticket::State.by_category_ids(:viewable_agent_edit))
  22. end
  23. end
  24. end