debian-mirror-gitlab/spec/requests/api/graphql/namespace/package_settings_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
979 B
Ruby
Raw Permalink Normal View History

2021-03-08 18:12:59 +05:30
# frozen_string_literal: true
require 'spec_helper'
2023-03-04 22:38:38 +05:30
RSpec.describe 'getting namespace package settings in a namespace', feature_category: :package_registry do
2021-03-08 18:12:59 +05:30
include GraphqlHelpers
let_it_be(:package_settings) { create(:namespace_package_setting) }
let_it_be(:namespace) { package_settings.namespace }
let_it_be(:current_user) { namespace.owner }
2021-09-30 23:02:18 +05:30
2021-03-08 18:12:59 +05:30
let(:package_settings_response) { graphql_data.dig('namespace', 'packageSettings') }
let(:fields) { all_graphql_fields_for('PackageSettings') }
let(:query) do
graphql_query_for(
'namespace',
{ 'fullPath' => namespace.full_path },
query_graphql_field('package_settings', {}, fields)
)
end
subject { post_graphql(query, current_user: current_user) }
it_behaves_like 'a working graphql query' do
before do
subject
end
it 'matches the JSON schema' do
expect(package_settings_response).to match_schema('graphql/namespace/package_settings')
end
end
end