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

rule_type_spec.rb « protection « container_registry « types « graphql « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 40a456093451397246254cd71fc1f4a0ac41712f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe GitlabSchema.types['ContainerRegistryProtectionRule'], feature_category: :container_registry do
  specify { expect(described_class.graphql_name).to eq('ContainerRegistryProtectionRule') }

  specify { expect(described_class.description).to be_present }

  specify { expect(described_class).to require_graphql_authorizations(:admin_container_image) }

  describe 'id' do
    subject { described_class.fields['id'] }

    it { is_expected.to have_non_null_graphql_type(::Types::GlobalIDType[::ContainerRegistry::Protection::Rule]) }
  end

  describe 'repository_path_pattern' do
    subject { described_class.fields['repositoryPathPattern'] }

    it { is_expected.to have_non_null_graphql_type(GraphQL::Types::String) }
  end

  describe 'push_protected_up_to_access_level' do
    subject { described_class.fields['pushProtectedUpToAccessLevel'] }

    it { is_expected.to have_non_null_graphql_type(Types::ContainerRegistry::Protection::RuleAccessLevelEnum) }
  end

  describe 'delete_protected_up_to_access_level' do
    subject { described_class.fields['deleteProtectedUpToAccessLevel'] }

    it { is_expected.to have_non_null_graphql_type(Types::ContainerRegistry::Protection::RuleAccessLevelEnum) }
  end
end