set_up.rb 643 B

123456789101112131415161718
  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.save!
  13. end
  14. end
  15. end