Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/audit_events.rb')
-rw-r--r--spec/factories/audit_events.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/factories/audit_events.rb b/spec/factories/audit_events.rb
index 10f60591922..ceb7516441f 100644
--- a/spec/factories/audit_events.rb
+++ b/spec/factories/audit_events.rb
@@ -88,6 +88,29 @@ FactoryBot.define do
end
end
+ trait :instance_event do
+ transient { instance_scope { Gitlab::Audit::InstanceScope.new } }
+
+ entity_type { Gitlab::Audit::InstanceScope.name }
+ entity_id { instance_scope.id }
+ entity_path { instance_scope.full_path }
+ target_details { instance_scope.name }
+ ip_address { IPAddr.new '127.0.0.1' }
+ details do
+ {
+ change: 'project_creation_level',
+ from: nil,
+ to: 'Developers + Maintainers',
+ author_name: user.name,
+ target_id: instance_scope.id,
+ target_type: Gitlab::Audit::InstanceScope.name,
+ target_details: instance_scope.name,
+ ip_address: '127.0.0.1',
+ entity_path: instance_scope.full_path
+ }
+ end
+ end
+
factory :project_audit_event, traits: [:project_event]
factory :group_audit_event, traits: [:group_event]
end