issue_4263_saml_display_name_spec.rb 1.1 KB

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