diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-22 15:10:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-22 15:10:30 +0300 |
commit | 49203bfa3c7eb607a7561ae7da9b5c52aa49fd77 (patch) | |
tree | f33cd54ec9a45d69a3e58fe93735070d3b718913 /spec/graphql | |
parent | 3c9a2dd62025043448c9ea9a6df86422874ee4be (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql')
-rw-r--r-- | spec/graphql/resolvers/ci/catalog/resources_resolver_spec.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/graphql/resolvers/ci/catalog/resources_resolver_spec.rb b/spec/graphql/resolvers/ci/catalog/resources_resolver_spec.rb index 97105db686f..47fef51dec2 100644 --- a/spec/graphql/resolvers/ci/catalog/resources_resolver_spec.rb +++ b/spec/graphql/resolvers/ci/catalog/resources_resolver_spec.rb @@ -9,8 +9,8 @@ RSpec.describe Resolvers::Ci::Catalog::ResourcesResolver, feature_category: :pip let_it_be(:project_1) { create(:project, name: 'Z', namespace: namespace) } let_it_be(:project_2) { create(:project, name: 'A_Test', namespace: namespace) } let_it_be(:project_3) { create(:project, name: 'L', description: 'Test', namespace: namespace) } - let_it_be(:resource_1) { create(:ci_catalog_resource, project: project_1) } - let_it_be(:resource_2) { create(:ci_catalog_resource, project: project_2) } + let_it_be(:published_resource_1) { create(:ci_catalog_resource, :published, project: project_1) } + let_it_be(:published_resource_2) { create(:ci_catalog_resource, :published, project: project_2) } let_it_be(:resource_3) { create(:ci_catalog_resource, project: project_3) } let_it_be(:user) { create(:user) } @@ -34,30 +34,30 @@ RSpec.describe Resolvers::Ci::Catalog::ResourcesResolver, feature_category: :pip namespace.add_owner(user) end - it 'returns all catalog resources visible to the current user in the namespace' do - expect(result.items.count).to be(3) - expect(result.items.pluck(:name)).to contain_exactly('Z', 'A_Test', 'L') + it 'returns all published catalog resources visible to the current user in the namespace' do + expect(result.items.count).to be(2) + expect(result.items.pluck(:name)).to contain_exactly('Z', 'A_Test') end context 'when the sort parameter is not provided' do - it 'returns all catalog resources sorted by descending created date' do - expect(result.items.pluck(:name)).to eq(%w[L A_Test Z]) + it 'returns all published catalog resources sorted by descending created date' do + expect(result.items.pluck(:name)).to eq(%w[A_Test Z]) end end context 'when the sort parameter is provided' do let(:sort) { 'NAME_DESC' } - it 'returns all catalog resources sorted by descending name' do - expect(result.items.pluck(:name)).to eq(%w[Z L A_Test]) + it 'returns all published catalog resources sorted by descending name' do + expect(result.items.pluck(:name)).to eq(%w[Z A_Test]) end end context 'when the search parameter is provided' do let(:search) { 'test' } - it 'returns the catalog resources that match the search term' do - expect(result.items.pluck(:name)).to contain_exactly('A_Test', 'L') + it 'returns published catalog resources that match the search term' do + expect(result.items.pluck(:name)).to contain_exactly('A_Test') end end end |