issue_2943_add_setting_enforce_special_character_spec.rb 558 B

123456789101112131415
  1. require 'rails_helper'
  2. RSpec.describe Issue2943AddSettingEnforceSpecialCharacter, type: :db_migration do
  3. before do
  4. Setting.find_by(name: :password_need_special_character).destroy
  5. end
  6. it 'adds password_need_special_character setting' do
  7. expect { migrate }.to change { Setting.exists?(name: :password_need_special_character) }.from(false).to(true)
  8. end
  9. it 'performs no action for new systems', system_init_done: false do
  10. expect { migrate }.not_to change { Setting.exists?(name: :password_need_special_character) }.from(false)
  11. end
  12. end