project_type_spec.rb 913 字节
Newer Older
1 2 3
require 'spec_helper'

describe GitlabSchema.types['Project'] do
4 5
  it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Project) }

6
  it { expect(described_class.graphql_name).to eq('Project') }
7 8

  describe 'nested merge request' do
9
    it { expect(described_class).to have_graphql_field(:merge_requests) }
10 11 12 13
    it { expect(described_class).to have_graphql_field(:merge_request) }

    it 'authorizes the merge request' do
      expect(described_class.fields['mergeRequest'])
14
        .to require_graphql_authorizations(:read_merge_request)
15
    end
16 17

    it 'authorizes the merge requests' do
18 19
      expect(described_class.fields['mergeRequests'])
        .to require_graphql_authorizations(:read_merge_request)
20
    end
21
  end
B
Bob Van Landuyt 已提交
22

P
Phil Hughes 已提交
23 24 25 26
  describe 'nested issues' do
    it { expect(described_class).to have_graphql_field(:issues) }
  end

B
Bob Van Landuyt 已提交
27
  it { is_expected.to have_graphql_field(:pipelines) }
28
end