+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
require 'test_helper'
require 'audit_logs'
end
test "non-empty configuration.unlogged_attributes" do
- Rails.configuration.unlogged_attributes = ["manifest_text"]
+ Rails.configuration.AuditLogs.UnloggedAttributes = ["manifest_text"]
txt = ". acbd18db4cc2f85cedef654fccc4a4d8+3 0:3:foo\n"
act_as_system_user do
end
test "empty configuration.unlogged_attributes" do
- Rails.configuration.unlogged_attributes = []
+ Rails.configuration.AuditLogs.UnloggedAttributes = []
txt = ". acbd18db4cc2f85cedef654fccc4a4d8+3 0:3:foo\n"
act_as_system_user do
test 'retain old audit logs with default settings' do
assert_no_logs_deleted do
AuditLogs.delete_old(
- max_age: Rails.configuration.max_audit_log_age,
- max_batch: Rails.configuration.max_audit_log_delete_batch)
+ max_age: Rails.configuration.AuditLogs.MaxAge,
+ max_batch: Rails.configuration.AuditLogs.MaxDeleteBatch)
end
end
test 'delete old audit logs in thread' do
begin
- Rails.configuration.max_audit_log_age = 20
- Rails.configuration.max_audit_log_delete_batch = 100000
+ Rails.configuration.AuditLogs.MaxAge = 20
+ Rails.configuration.AuditLogs.MaxDeleteBatch = 100000
Rails.cache.delete 'AuditLogs'
initial_log_count = Log.unscoped.all.count + 1
act_as_system_user do