trabajo-afectivo/spec/support/system_init_done.rb

18 lines
588 B
Ruby
Raw Permalink Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
module SystemInitDoneHelper
def system_init_done(state = true)
# generally allow all calls to Setting.exists? to avoid
# RSpec errors where a different Setting is accessed
allow(Setting).to receive(:exists?).and_call_original
# just mock the Setting check for `system_init_done`
# and return the given parameter value
allow(Setting).to receive(:exists?).with(name: 'system_init_done').and_return(state)
end
end
RSpec.configure do |config|
config.include SystemInitDoneHelper
end