trabajo-afectivo/spec/db/migrate/issue_3669_fix_domain_spec.rb

50 lines
1.2 KiB
Ruby
Raw Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
require 'rails_helper'
RSpec.describe Issue3669FixDomain, type: :db_migration do
let!(:channel) do
channel_options = {
inbound: {
adapter: 'imap',
options: {
auth_type: 'XOAUTH2',
host: 'imap.gmail.com',
ssl: true,
user: 'example@gmail.com',
},
},
outbound: {
adapter: 'smtp',
options: {
host: 'smtp.gmail.com',
domain: 'gmail.com',
port: 465,
ssl: true,
user: 'example@gmail.com',
authentication: 'xoauth2',
},
},
auth: {
provider: 'google',
type: 'XOAUTH2',
client_id: 'abc',
client_secret: 'efg',
},
}
Channel.create!(
area: 'Google::Account',
group_id: Group.first.id,
options: channel_options,
active: false,
created_by_id: 1,
updated_by_id: 1,
)
end
it 'removes domain from the configuration' do
expect { migrate }.to change { channel.reload.options[:outbound][:options][:domain] }.to(nil)
end
end