exchange_spec.rb 851 B

123456789101112131415161718192021222324252627282930
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe ExternalCredential::Exchange do
  4. describe '.refresh_token' do
  5. # https://github.com/zammad/zammad/issues/4454
  6. context 'when Exchange integration is not configured at all' do
  7. before do
  8. Setting.set('exchange_oauth', {})
  9. Setting.set('exchange_integration', true)
  10. end
  11. it 'does always return a value' do
  12. expect(described_class.refresh_token).to be_truthy
  13. end
  14. end
  15. # https://github.com/zammad/zammad/issues/4961
  16. context 'when Exchange integration is not enabled' do
  17. before do
  18. Setting.set('exchange_integration', false)
  19. end
  20. it 'does always return a value' do
  21. expect(described_class.refresh_token).to be_truthy
  22. end
  23. end
  24. end
  25. end