diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /spec/requests/api/graphql/namespace | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'spec/requests/api/graphql/namespace')
-rw-r--r-- | spec/requests/api/graphql/namespace/package_settings_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/requests/api/graphql/namespace/package_settings_spec.rb b/spec/requests/api/graphql/namespace/package_settings_spec.rb new file mode 100644 index 00000000000..6af098e902f --- /dev/null +++ b/spec/requests/api/graphql/namespace/package_settings_spec.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'getting namespace package settings in a namespace' do + 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 } + 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 |