diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-14 00:10:29 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-14 00:10:29 +0000 |
commit | 3521fa595b022a402f3ed1e8c423021e6ad8ae49 (patch) | |
tree | 6cfbb28fcf84409f42212753abd05740ceeae3e4 /spec/requests/api | |
parent | 21eec1097daf6817af98894cf53fa436a25c5ce1 (diff) | |
download | gitlab-ce-3521fa595b022a402f3ed1e8c423021e6ad8ae49.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api')
5 files changed, 38 insertions, 4 deletions
diff --git a/spec/requests/api/graphql/ci/jobs_spec.rb b/spec/requests/api/graphql/ci/jobs_spec.rb index 8c4ab13fc35..fa8fb1d54aa 100644 --- a/spec/requests/api/graphql/ci/jobs_spec.rb +++ b/spec/requests/api/graphql/ci/jobs_spec.rb @@ -335,4 +335,35 @@ RSpec.describe 'Query.project.pipeline' do end end end + + context 'when querying jobs for multiple projects' do + let(:query) do + %( + query { + projects { + nodes { + jobs { + nodes { + name + } + } + } + } + } + ) + end + + before do + create_list(:project, 2).each do |project| + project.add_developer(user) + create(:ci_build, project: project) + end + end + + it 'returns an error' do + post_graphql(query, current_user: user) + + expect_graphql_errors_to_include [/"jobs" field can be requested only for 1 Project\(s\) at a time./] + end + end end diff --git a/spec/requests/api/graphql/ci/runner_spec.rb b/spec/requests/api/graphql/ci/runner_spec.rb index 8bd002d533a..bd90753f9ad 100644 --- a/spec/requests/api/graphql/ci/runner_spec.rb +++ b/spec/requests/api/graphql/ci/runner_spec.rb @@ -429,6 +429,8 @@ RSpec.describe 'Query.runner(id)' do 'jobs' => nil, # returning jobs not allowed for more than 1 runner (see RunnerJobsResolver) 'projectCount' => nil, 'projects' => nil) + + expect_graphql_errors_to_include [/"jobs" field can be requested only for 1 CiRunner\(s\) at a time./] end end end diff --git a/spec/requests/api/graphql/environments/deployments_query_spec.rb b/spec/requests/api/graphql/environments/deployments_query_spec.rb index 95cc83e9463..6da00057449 100644 --- a/spec/requests/api/graphql/environments/deployments_query_spec.rb +++ b/spec/requests/api/graphql/environments/deployments_query_spec.rb @@ -238,8 +238,9 @@ RSpec.describe 'Environments Deployments query' do ) end - it 'returnes an error for preventing N+1 queries' do - expect(subject['errors'][0]['message']).to include('exceeds max complexity') + it 'returns an error for preventing N+1 queries' do + expect(subject['errors'][0]['message']) + .to include('"deployments" field can be requested only for 1 Environment(s) at a time.') end end diff --git a/spec/requests/api/graphql/group/packages_spec.rb b/spec/requests/api/graphql/group/packages_spec.rb index adee556db3a..cf8736db5af 100644 --- a/spec/requests/api/graphql/group/packages_spec.rb +++ b/spec/requests/api/graphql/group/packages_spec.rb @@ -39,7 +39,7 @@ RSpec.describe 'getting a package list for a group' do it 'returns an error for the second group and data for the first' do expect(a_packages_names).to contain_exactly(group_one_package.name) - expect_graphql_errors_to_include [/Packages can be requested only for one group at a time/] + expect_graphql_errors_to_include [/"packages" field can be requested only for 1 Group\(s\) at a time./] expect(graphql_data_at(:b, :packages)).to be(nil) end end diff --git a/spec/requests/api/graphql/packages/package_spec.rb b/spec/requests/api/graphql/packages/package_spec.rb index c28b37db5af..b9bb57c7df7 100644 --- a/spec/requests/api/graphql/packages/package_spec.rb +++ b/spec/requests/api/graphql/packages/package_spec.rb @@ -97,7 +97,7 @@ RSpec.describe 'package details' do expect(graphql_data_at(:a, :name)).to eq(composer_package.name) - expect_graphql_errors_to_include [/Package details can be requested only for one package at a time/] + expect_graphql_errors_to_include [/"package" field can be requested only for 1 Query\(s\) at a time./] expect(graphql_data_at(:b)).to be(nil) end end |