issue_3446_microsoft_365_tenants_spec.rb 692 B

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