2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2018-09-28 12:52:06 +00:00
|
|
|
RSpec.configure do |config|
|
|
|
|
|
|
|
|
config.around(:example, last_admin_check: false) do |example|
|
|
|
|
|
|
|
|
User.class_eval do
|
|
|
|
alias_method :original_last_admin_check_admin_count, :last_admin_check_admin_count
|
|
|
|
|
|
|
|
def last_admin_check_admin_count
|
|
|
|
1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
example.run
|
|
|
|
|
|
|
|
User.class_eval do
|
|
|
|
alias_method :last_admin_check_admin_count, :original_last_admin_check_admin_count
|
|
|
|
remove_method :original_last_admin_check_admin_count
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|