issue3110_service_now_provider_spec.rb 739 B

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