set_up.rb 719 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. RSpec.configure do |config|
  3. config.before(:each, type: :system) do |example|
  4. # check if system should get set up
  5. next if !example.metadata.fetch(:set_up, true)
  6. # check if system is already set up and perform setup via auto_wizard if needed
  7. Rake::Task['zammad:setup:auto_wizard'].execute if !Setting.get('system_init_done')
  8. # skip intro/clues for created agents/admins
  9. %w[admin@example.com agent1@example.com].each do |login|
  10. user = User.find_by(login: login)
  11. user.preferences[:intro] = true
  12. user.preferences[:keyboard_shortcuts_clues] = true
  13. user.save!
  14. end
  15. end
  16. end