issue_2185_and_or_conditions_spec.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Issue2185AndOrConditions, type: :db_migration do
  4. before do
  5. %w[ticket_hook ticket_hook_position ticket_last_contact_behaviour].each do |name|
  6. setting = Setting.find_by(name: name)
  7. setting[:preferences].delete(:prio)
  8. setting.save
  9. end
  10. Setting.find_by(name: 'ticket_allow_expert_conditions').destroy!
  11. migrate
  12. end
  13. it 'migrates prio of ticket_hook setting' do
  14. expect(Setting.find_by(name: 'ticket_hook')[:preferences][:prio]).to eq(1000)
  15. end
  16. it 'migrates prio of ticket_hook_position setting' do
  17. expect(Setting.find_by(name: 'ticket_hook_position')[:preferences][:prio]).to eq(2000)
  18. end
  19. it 'migrates prio of ticket_last_contact_behaviour setting' do
  20. expect(Setting.find_by(name: 'ticket_last_contact_behaviour')[:preferences][:prio]).to eq(3000)
  21. end
  22. it 'creates ticket_allow_expert_conditions setting' do
  23. expect(Setting.find_by(name: 'ticket_allow_expert_conditions')).not_to be_nil
  24. end
  25. end