diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/support/shared_examples/finders/issues_finder_shared_examples.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/support/shared_examples/finders/issues_finder_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/finders/issues_finder_shared_examples.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/support/shared_examples/finders/issues_finder_shared_examples.rb b/spec/support/shared_examples/finders/issues_finder_shared_examples.rb index 043d6db66d3..a5fee9c5fed 100644 --- a/spec/support/shared_examples/finders/issues_finder_shared_examples.rb +++ b/spec/support/shared_examples/finders/issues_finder_shared_examples.rb @@ -269,6 +269,34 @@ RSpec.shared_examples 'issues or work items finder' do |factory, execute_context end end end + + context 'when querying group-level items' do + let(:params) { { group_id: group.id, issue_types: %w[issue epic] } } + + it 'includes group-level items' do + expect(items).to contain_exactly(item1, item5, group_level_item) + end + + context 'when user has access to confidential items' do + before do + group.add_reporter(user) + end + + it 'includes confidential group-level items' do + expect(items).to contain_exactly(item1, item5, group_level_item, group_level_confidential_item) + end + end + + context 'when namespace_level_work_items is disabled' do + before do + stub_feature_flags(namespace_level_work_items: false) + end + + it 'only returns project-level items' do + expect(items).to contain_exactly(item1, item5) + end + end + end end context 'filtering by author' do |