issue_4412_setting_saml_logout_url_spec.rb 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Issue4412SettingSamlLogoutUrl, type: :db_migration do
  4. before do
  5. old_saml_form = Setting.find_by(name: 'auth_saml_credentials').options[:form]
  6. old_saml_form.delete_at(2)
  7. Setting.create_or_update(
  8. title: __('SAML App Credentials'),
  9. name: 'auth_saml_credentials',
  10. area: 'Security::ThirdPartyAuthentication::SAML',
  11. description: __('Enables user authentication via SAML.'),
  12. options: {
  13. form: old_saml_form
  14. }
  15. )
  16. migrate
  17. end
  18. let(:migrated_setting) do
  19. {
  20. display: __('IDP Single Logout target URL'),
  21. null: true,
  22. name: 'idp_slo_service_url',
  23. tag: 'input',
  24. placeholder: 'https://capriza.github.io/samling/slo.html',
  25. }
  26. end
  27. it 'does migrate auth_saml_credentials setting' do
  28. expect(Setting.find_by(name: 'auth_saml_credentials').options[:form][2]).to eq(migrated_setting.deep_stringify_keys)
  29. end
  30. end