system_init_done.rb 588 B

1234567891011121314151617
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. module SystemInitDoneHelper
  3. def system_init_done(state = true)
  4. # generally allow all calls to Setting.exists? to avoid
  5. # RSpec errors where a different Setting is accessed
  6. allow(Setting).to receive(:exists?).and_call_original
  7. # just mock the Setting check for `system_init_done`
  8. # and return the given parameter value
  9. allow(Setting).to receive(:exists?).with(name: 'system_init_done').and_return(state)
  10. end
  11. end
  12. RSpec.configure do |config|
  13. config.include SystemInitDoneHelper
  14. end