issue3110_service_now_provider_spec.rb 816 B

1234567891011121314151617181920212223242526272829
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Issue3110ServiceNowProvider, type: :db_migration do
  4. let(:ticket) { create(:ticket) }
  5. let(:external_sync) do
  6. create(:external_sync,
  7. source: 'ServiceNow',
  8. source_id: 'INC678439',
  9. object: 'Ticket',
  10. o_id: ticket.id)
  11. end
  12. before do
  13. create(:ticket_article,
  14. ticket: ticket,
  15. subject: 'Incident INC678439 -- zugewiesen an EXT-XXXINIS',
  16. from: 'zam@mad-service-now.com')
  17. end
  18. it 'does migrates obsolete ServiceNow ExternalSync references' do
  19. expect { migrate }
  20. .to change { external_sync.reload.source }
  21. .from('ServiceNow')
  22. .to('ServiceNow-zam@mad-service-now.com')
  23. end
  24. end