setting_update_password_max_login_failed_spec.rb 752 B

12345678910111213141516171819202122232425
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe SettingUpdatePasswordMaxLoginFailed, type: :db_migration do
  4. context 'when having old password max login failed setting values' do
  5. before do
  6. setting.preferences = {
  7. permission: ['admin.security'],
  8. }
  9. setting.frontend = false
  10. setting.save!
  11. end
  12. let(:setting) { Setting.find_by(name: 'password_max_login_failed') }
  13. it 'add authentication to preferences' do
  14. expect { migrate }.to change { setting.reload.preferences[:authentication] }.to(true)
  15. end
  16. it 'change frontend flag to true' do
  17. expect { migrate }.to change { setting.reload.frontend }.to(true)
  18. end
  19. end
  20. end