2017-08-16 13:04:41 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe GitlabSchema.types['Query'] do
|
|
|
|
it 'is called Query' do
|
2018-05-23 07:55:14 +00:00
|
|
|
expect(described_class.graphql_name).to eq('Query')
|
2017-08-16 13:04:41 +00:00
|
|
|
end
|
|
|
|
|
2018-06-14 13:06:53 +00:00
|
|
|
it { is_expected.to have_graphql_fields(:project, :echo) }
|
2017-08-16 13:04:41 +00:00
|
|
|
|
|
|
|
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)
|
2018-05-23 07:55:14 +00:00
|
|
|
is_expected.to have_graphql_resolver(Resolvers::ProjectResolver)
|
2017-08-16 13:04:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'authorizes with read_project' do
|
|
|
|
is_expected.to require_graphql_authorizations(:read_project)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|