verify_spec.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe EmailHelper::Verify, integration: true, required_envs: %w[MAIL_SERVER MAIL_ADDRESS MAIL_PASS] do
  4. describe '#email' do
  5. subject(:verify_result) { described_class.email(verify_params) }
  6. let(:mailbox_user) { ENV['MAIL_ADDRESS'] }
  7. let(:mailbox_password) { ENV['MAIL_PASS'] }
  8. let(:verify_params) do
  9. {
  10. inbound: {
  11. adapter: 'imap',
  12. options: {
  13. host: ENV['MAIL_SERVER'],
  14. port: 993,
  15. ssl: true,
  16. user: mailbox_user,
  17. password: mailbox_password,
  18. ssl_verify: false,
  19. },
  20. },
  21. outbound: {
  22. adapter: 'smtp',
  23. options: {
  24. host: ENV['MAIL_SERVER'],
  25. port: 25,
  26. ssl: false,
  27. user: mailbox_user,
  28. password: mailbox_password,
  29. ssl_verify: false,
  30. },
  31. },
  32. sender: mailbox_user,
  33. }
  34. end
  35. it { is_expected.to include(result: 'ok') }
  36. end
  37. end