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

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

# Shared example for legal queries that are expected to return nil.
# Requires the following let bindings to be defined:
#  - post_query: action to send the query
#  - path: array of keys from query root to the result
RSpec.shared_examples 'a failure to find anything' do
  it 'finds nothing' do
    post_query

    data = graphql_data.dig(*path)

    expect(data).to be_nil
  end
end