imap_spec.rb 720 B

1234567891011121314151617181920212223242526
  1. require 'rails_helper'
  2. RSpec.describe Channel::Driver::Imap do
  3. # https://github.com/zammad/zammad/issues/2964
  4. context 'when connecting with a ASCII 8-Bit password' do
  5. it 'succeeds' do
  6. required_envs = %w[IMAP_ASCII_8BIT_HOST IMAP_ASCII_8BIT_USER IMAP_ASCII_8BIT_PASSWORD]
  7. required_envs.each do |key|
  8. next if ENV[key].present?
  9. skip("Need ENVs #{required_envs.join(', ')}.")
  10. end
  11. params = {
  12. host: ENV['IMAP_ASCII_8BIT_HOST'],
  13. user: ENV['IMAP_ASCII_8BIT_USER'],
  14. password: ENV['IMAP_ASCII_8BIT_PASSWORD'],
  15. }
  16. result = described_class.new.fetch(params, nil, 'check')
  17. expect(result.dig(:result)).to eq 'ok'
  18. end
  19. end
  20. end