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

gitlab_schema_spec.rb « graphql « api « requests « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 708a000532be2603fc86a57148dfd28d8101a595 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'spec_helper'

describe 'GitlabSchema configurations' do
  include GraphqlHelpers

  let(:project) { create(:project, :repository) }
  let!(:query)  { graphql_query_for('project', 'fullPath' => project.full_path) }

  it 'shows an error if complexity it too high' do
    allow(GitlabSchema).to receive(:max_query_complexity).and_return 1

    post_graphql(query, current_user: nil)

    expect(graphql_errors.first['message']).to include('which exceeds max complexity of 1')
  end
end