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

query_type_spec.rb « types « graphql « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e1df6f9811d4227f2436b508f8f9252447302425 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'spec_helper'

describe GitlabSchema.types['Query'] do
  it 'is called Query' do
    expect(described_class.graphql_name).to eq('Query')
  end

  it { is_expected.to have_graphql_fields(:project, :echo) }

  describe 'project field' do
    subject { described_class.fields['project'] }

    it 'finds projects by full path' do
      is_expected.to have_graphql_arguments(:full_path)
      is_expected.to have_graphql_type(Types::ProjectType)
      is_expected.to have_graphql_resolver(Resolvers::ProjectResolver)
    end

    it 'authorizes with read_project' do
      is_expected.to require_graphql_authorizations(:read_project)
    end
  end
end