maintenance_improve_setting_preferences_spec.rb 542 B

123456789101112131415161718
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe MaintenanceImproveSettingPreferences, type: :db_migration do
  4. context 'when having old setting preferences without protected flag' do
  5. before do
  6. setting.preferences.delete(:protected)
  7. setting.save!
  8. end
  9. let(:setting) { Setting.find_by(name: 'application_secret') }
  10. it 'add protected flag' do
  11. expect { migrate }.to change { setting.reload.preferences[:protected] }.to(true)
  12. end
  13. end
  14. end