trabajo-afectivo/spec/support/last_admin_check.rb

23 lines
558 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/
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