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

issuable_search_shared_examples.rb « graphql « api « requests « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bb492425fd768b14d3d27db7caa77022f53a4f31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

# Requires `query(params)` , `user`, `issuable_data` and `issuable` bindings
RSpec.shared_examples 'query with a search term' do |fields = [:DESCRIPTION]|
  let(:search_term) { 'bar' }
  let(:ids) { graphql_dig_at(issuable_data, :node, :id) }

  it 'returns only matching issuables' do
    filter_params = { search: search_term, in: fields }
    graphql_query = query(filter_params)

    post_graphql(graphql_query, current_user: user)

    expect(ids).to contain_exactly(issuable.to_global_id.to_s)
  end
end