diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-03 00:07:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-03 00:07:46 +0300 |
commit | 9579eee8954e0405c2dadb19c2a73c9597ce37ea (patch) | |
tree | d90223b7e449d8d25eef60ad16084ce0d2ca2b1b /spec/support/shared_contexts | |
parent | 0a9b6b99a9bdcacea434501320f1a8d131a33827 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_contexts')
-rw-r--r-- | spec/support/shared_contexts/requests/api/graphql/releases_and_group_releases_shared_context.rb | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/spec/support/shared_contexts/requests/api/graphql/releases_and_group_releases_shared_context.rb b/spec/support/shared_contexts/requests/api/graphql/releases_and_group_releases_shared_context.rb new file mode 100644 index 00000000000..81076ea6fdc --- /dev/null +++ b/spec/support/shared_contexts/requests/api/graphql/releases_and_group_releases_shared_context.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +RSpec.shared_context 'when releases and group releases shared context' do + let_it_be(:stranger) { create(:user) } + let_it_be(:guest) { create(:user) } + let_it_be(:reporter) { create(:user) } + let_it_be(:developer) { create(:user) } + + let(:base_url_params) { { scope: 'all', release_tag: release.tag } } + let(:opened_url_params) { { state: 'opened', **base_url_params } } + let(:merged_url_params) { { state: 'merged', **base_url_params } } + let(:closed_url_params) { { state: 'closed', **base_url_params } } + + let(:query) do + graphql_query_for(resource_type, { fullPath: resource.full_path }, + %( + releases { + count + nodes { + tagName + tagPath + name + commit { + sha + } + assets { + count + sources { + nodes { + url + } + } + } + evidences { + nodes { + sha + } + } + links { + selfUrl + openedMergeRequestsUrl + mergedMergeRequestsUrl + closedMergeRequestsUrl + openedIssuesUrl + closedIssuesUrl + } + } + } + )) + end + + let(:params_for_issues_and_mrs) { { scope: 'all', state: 'opened', release_tag: release.tag } } + let(:post_query) { post_graphql(query, current_user: current_user) } + + let(:data) { graphql_data.dig(resource_type.to_s, 'releases', 'nodes', 0) } + + before do + stub_default_url_options(host: 'www.example.com') + end +end |