issue_3446_microsoft_365_tenants_spec.rb 768 B

123456789101112131415161718192021222324252627
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Issue3446Microsoft365Tenants, type: :db_migration do
  4. context 'when having pre-tenant setting' do
  5. before do
  6. setting.options['form'] = setting.options['form'].slice 0, 2
  7. setting.save!
  8. end
  9. let(:setting) { Setting.find_by(name: 'auth_microsoft_office365_credentials') }
  10. it 'adds tenant field to form options' do
  11. expect { migrate }
  12. .to change { setting.reload.options['form'].last['name'] }
  13. .to('app_tenant')
  14. end
  15. it 'changes form fields count from 2 to 3' do
  16. expect { migrate }
  17. .to change { setting.reload.options['form'].count }
  18. .from(2)
  19. .to(3)
  20. end
  21. end
  22. end