diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-05 21:09:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-05 21:09:44 +0300 |
commit | 2f1a81fd16ff9968d6b986f8a407d963bc2218f9 (patch) | |
tree | d079c1abc2bc282e749a676651c0f02d288874f3 /spec/requests | |
parent | 18e9429b63f9a095b1ba3606856537b9ca291eac (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/graphql/audit_events/definitions_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/requests/api/graphql/audit_events/definitions_spec.rb b/spec/requests/api/graphql/audit_events/definitions_spec.rb new file mode 100644 index 00000000000..4e0f4dcfae1 --- /dev/null +++ b/spec/requests/api/graphql/audit_events/definitions_spec.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'getting a list of audit event definitions', feature_category: :audit_events do + include GraphqlHelpers + + let_it_be(:current_user) { create(:user) } + + let(:path) { %i[audit_event_definitions nodes] } + let(:audit_event_definition_keys) do + Gitlab::Audit::Type::Definition.definitions.keys + end + + let(:query) { graphql_query_for(:audit_event_definitions, {}, 'nodes { name }') } + + it 'returns the audit event definitions' do + post_graphql(query, current_user: current_user) + + returned_names = graphql_data_at(*path).map { |v| v['name'].to_sym } + + expect(returned_names).to all be_in(audit_event_definition_keys) + end +end |