diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-06 00:09:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-06 00:09:03 +0300 |
commit | 250c4c259654a5d971a7daac846239c70954215b (patch) | |
tree | 92ef30c620c5baf8b350536c923a2cd2270d1b87 /spec/graphql | |
parent | 6ba372cf11e46ec9841b511f327155968f51f2ac (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql')
-rw-r--r-- | spec/graphql/resolvers/group_packages_resolver_spec.rb | 18 | ||||
-rw-r--r-- | spec/graphql/resolvers/project_packages_resolver_spec.rb (renamed from spec/graphql/resolvers/packages_resolver_spec.rb) | 2 | ||||
-rw-r--r-- | spec/graphql/types/group_type_spec.rb | 1 |
3 files changed, 20 insertions, 1 deletions
diff --git a/spec/graphql/resolvers/group_packages_resolver_spec.rb b/spec/graphql/resolvers/group_packages_resolver_spec.rb new file mode 100644 index 00000000000..59438b8d5ad --- /dev/null +++ b/spec/graphql/resolvers/group_packages_resolver_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Resolvers::GroupPackagesResolver do + include GraphqlHelpers + + let_it_be(:user) { create(:user) } + let_it_be(:group) { create(:group, :public) } + let_it_be(:project) { create(:project, :public, group: group) } + let_it_be(:package) { create(:package, project: project) } + + describe '#resolve' do + subject(:packages) { resolve(described_class, ctx: { current_user: user }, obj: group) } + + it { is_expected.to contain_exactly(package) } + end +end diff --git a/spec/graphql/resolvers/packages_resolver_spec.rb b/spec/graphql/resolvers/project_packages_resolver_spec.rb index bc0588daf7f..c8105ed2a38 100644 --- a/spec/graphql/resolvers/packages_resolver_spec.rb +++ b/spec/graphql/resolvers/project_packages_resolver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Resolvers::PackagesResolver do +RSpec.describe Resolvers::ProjectPackagesResolver do include GraphqlHelpers let_it_be(:user) { create(:user) } diff --git a/spec/graphql/types/group_type_spec.rb b/spec/graphql/types/group_type_spec.rb index bba702ba3e9..ef11e3d309c 100644 --- a/spec/graphql/types/group_type_spec.rb +++ b/spec/graphql/types/group_type_spec.rb @@ -18,6 +18,7 @@ RSpec.describe GitlabSchema.types['Group'] do two_factor_grace_period auto_devops_enabled emails_disabled mentions_disabled parent boards milestones group_members merge_requests container_repositories container_repositories_count + packages ] expect(described_class).to include_graphql_fields(*expected_fields) |