issue_3964_inbound_fix_options_spec.rb 775 B

1234567891011121314151617181920212223242526272829303132
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Issue3964InboundFixOptions, type: :db_migration do
  4. let(:channel) do
  5. build(:google_channel)
  6. .tap { _1.options[:inbound][:options][:ssl] = old_value }
  7. .tap(&:save!)
  8. end
  9. before do
  10. channel
  11. migrate
  12. end
  13. context 'when old value is true' do
  14. let(:old_value) { true }
  15. it 'sets the correct ssl value for ssl true' do
  16. expect(channel.reload.options[:inbound][:options][:ssl]).to eq('ssl')
  17. end
  18. end
  19. context 'when old value is false' do
  20. let(:old_value) { false }
  21. it 'sets the correct ssl value for ssl false' do
  22. expect(channel.reload.options[:inbound][:options][:ssl]).to eq('off')
  23. end
  24. end
  25. end