2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2021-03-08 13:13:15 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe Issue3446Microsoft365Tenants, type: :db_migration do
|
|
|
|
context 'when having pre-tenant setting' do
|
|
|
|
before do
|
|
|
|
setting.options['form'] = setting.options['form'].slice 0, 2
|
|
|
|
setting.save!
|
|
|
|
end
|
|
|
|
|
|
|
|
let(:setting) { Setting.find_by(name: 'auth_microsoft_office365_credentials') }
|
|
|
|
|
|
|
|
it 'adds tenant field to form options' do
|
|
|
|
expect { migrate }
|
|
|
|
.to change { setting.reload.options['form'].last['name'] }
|
|
|
|
.to('app_tenant')
|
|
|
|
end
|
|
|
|
|
2021-09-22 06:53:16 +00:00
|
|
|
it 'changes form fields count from 2 to 3' do
|
2021-03-08 13:13:15 +00:00
|
|
|
expect { migrate }
|
|
|
|
.to change { setting.reload.options['form'].count }
|
|
|
|
.from(2)
|
|
|
|
.to(3)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|