diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-16 09:08:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-16 09:08:48 +0300 |
commit | b394e58cc2e52e17e7991e3d7b705aa383c362ee (patch) | |
tree | c8fd512f3b9018ff2d007161b825ff22463370d4 /spec/lib | |
parent | e5aec0ddbc6e3122f5e2425e92b30c4cd2184c90 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/audit/type/definition_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/lib/gitlab/audit/type/definition_spec.rb b/spec/lib/gitlab/audit/type/definition_spec.rb index d1d6b0d7a78..9c311677883 100644 --- a/spec/lib/gitlab/audit/type/definition_spec.rb +++ b/spec/lib/gitlab/audit/type/definition_spec.rb @@ -281,6 +281,30 @@ RSpec.describe Gitlab::Audit::Type::Definition do end end + describe '.names_with_category' do + let(:store1) { Dir.mktmpdir('path1') } + + before do + allow(described_class).to receive(:paths).and_return( + [ + File.join(store1, '**', '*.yml') + ] + ) + end + + subject { described_class.names_with_category } + + after do + FileUtils.rm_rf(store1) + end + + it "returns an array with just the event name and feature category" do + write_audit_event_type(store1, path, yaml_content) + + expect(subject).to eq([{ event_name: :group_deploy_token_destroyed, feature_category: 'continuous_delivery' }]) + end + end + def write_audit_event_type(store, path, content) path = File.join(store, path) dir = File.dirname(path) |