trabajo-afectivo/spec/db/migrate/issue_3446_microsoft_365_tenants_spec.rb
2022-01-01 14:38:12 +01:00

27 lines
768 B
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
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
it 'changes form fields count from 2 to 3' do
expect { migrate }
.to change { setting.reload.options['form'].count }
.from(2)
.to(3)
end
end
end