diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 21:09:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 21:09:05 +0300 |
commit | c2367afbf57ebc65d5b78a743b5d6a91f0aece9f (patch) | |
tree | 165c2c54bf72ab3a3a9417d97f63ece5c9eba9f5 /spec/support/shared_contexts | |
parent | 51a9512965d86e3094968fa514e4ae8a96d38cf3 (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/group_and_project_boards_query_shared_context.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/support/shared_contexts/requests/api/graphql/group_and_project_boards_query_shared_context.rb b/spec/support/shared_contexts/requests/api/graphql/group_and_project_boards_query_shared_context.rb index e744c3d0abb..ca77c68c130 100644 --- a/spec/support/shared_contexts/requests/api/graphql/group_and_project_boards_query_shared_context.rb +++ b/spec/support/shared_contexts/requests/api/graphql/group_and_project_boards_query_shared_context.rb @@ -5,6 +5,8 @@ RSpec.shared_context 'group and project boards query context' do let(:current_user) { user } let(:params) { '' } let(:board_parent_type) { board_parent.class.to_s.downcase } + let(:boards_data) { graphql_data[board_parent_type]['boards']['edges'] } + let(:board_data) { graphql_data[board_parent_type]['board'] } let(:start_cursor) { graphql_data[board_parent_type]['boards']['pageInfo']['startCursor'] } let(:end_cursor) { graphql_data[board_parent_type]['boards']['pageInfo']['endCursor'] } @@ -28,6 +30,18 @@ RSpec.shared_context 'group and project boards query context' do ) end + def query_single_board(board_params = params) + graphql_query_for( + board_parent_type, + { 'fullPath' => board_parent.full_path }, + <<~BOARD + board(#{board_params}) { + #{all_graphql_fields_for('board'.classify)} + } + BOARD + ) + end + def grab_names(data = boards_data) data.map do |board| board.dig('node', 'name') |