2020-10-22 15:08:25 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe GitlabSchema.types['ContainerRepository'] do
|
2022-04-20 00:09:27 +00:00
|
|
|
fields = %i[id name path location created_at updated_at expiration_policy_started_at
|
|
|
|
status tags_count can_delete expiration_policy_cleanup_status project
|
|
|
|
migration_state]
|
2020-10-22 15:08:25 +00:00
|
|
|
|
|
|
|
it { expect(described_class.graphql_name).to eq('ContainerRepository') }
|
|
|
|
|
|
|
|
it { expect(described_class.description).to eq('A container repository') }
|
|
|
|
|
|
|
|
it { expect(described_class).to require_graphql_authorizations(:read_container_image) }
|
|
|
|
|
|
|
|
it { expect(described_class).to have_graphql_fields(fields) }
|
|
|
|
|
|
|
|
describe 'status field' do
|
|
|
|
subject { described_class.fields['status'] }
|
|
|
|
|
|
|
|
it 'returns status enum' do
|
|
|
|
is_expected.to have_graphql_type(Types::ContainerRepositoryStatusEnum)
|
|
|
|
end
|
|
|
|
end
|
2020-11-17 09:09:23 +00:00
|
|
|
|
|
|
|
describe 'expiration_policy_cleanup_status field' do
|
|
|
|
subject { described_class.fields['expirationPolicyCleanupStatus'] }
|
|
|
|
|
|
|
|
it 'returns cleanup status enum' do
|
|
|
|
is_expected.to have_graphql_type(Types::ContainerRepositoryCleanupStatusEnum)
|
|
|
|
end
|
|
|
|
end
|
2020-10-22 15:08:25 +00:00
|
|
|
end
|