set_up.rb 567 B

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