blob: 4e0f4dcfae14114d4786c3cf04bd8a5525f9fd81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
|