diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-25 15:07:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-25 15:07:22 +0300 |
commit | fc4faf47ac4e5f1ddc40640c42c32405c38c9455 (patch) | |
tree | f6d8642f577eda485efc0570300b5da28f0a7dfe /spec/finders | |
parent | 91a7f1897e7cb14d60c2aaf3afa76ebdc879d939 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/group_members_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/groups/accepting_project_creations_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/groups/accepting_project_shares_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/groups/user_groups_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/members_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/releases/group_releases_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/releases_finder_spec.rb | 24 |
7 files changed, 12 insertions, 24 deletions
diff --git a/spec/finders/group_members_finder_spec.rb b/spec/finders/group_members_finder_spec.rb index 4fc49289fa4..4ac4dc3ba37 100644 --- a/spec/finders/group_members_finder_spec.rb +++ b/spec/finders/group_members_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe GroupMembersFinder, '#execute', feature_category: :subgroups do +RSpec.describe GroupMembersFinder, '#execute', feature_category: :groups_and_projects do let_it_be(:group) { create(:group) } let_it_be(:sub_group) { create(:group, parent: group) } let_it_be(:sub_sub_group) { create(:group, parent: sub_group) } diff --git a/spec/finders/groups/accepting_project_creations_finder_spec.rb b/spec/finders/groups/accepting_project_creations_finder_spec.rb index 2ea5577dd90..61d673d6a99 100644 --- a/spec/finders/groups/accepting_project_creations_finder_spec.rb +++ b/spec/finders/groups/accepting_project_creations_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Groups::AcceptingProjectCreationsFinder, feature_category: :subgroups do +RSpec.describe Groups::AcceptingProjectCreationsFinder, feature_category: :groups_and_projects do let_it_be(:user) { create(:user) } let_it_be(:group_where_direct_owner) { create(:group) } let_it_be(:subgroup_of_group_where_direct_owner) { create(:group, parent: group_where_direct_owner) } diff --git a/spec/finders/groups/accepting_project_shares_finder_spec.rb b/spec/finders/groups/accepting_project_shares_finder_spec.rb index 6af3fad2110..f5fd865cf4d 100644 --- a/spec/finders/groups/accepting_project_shares_finder_spec.rb +++ b/spec/finders/groups/accepting_project_shares_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Groups::AcceptingProjectSharesFinder, feature_category: :subgroups do +RSpec.describe Groups::AcceptingProjectSharesFinder, feature_category: :groups_and_projects do subject(:result) { described_class.new(current_user, project, params).execute } let_it_be_with_reload(:current_user) { create(:user) } diff --git a/spec/finders/groups/user_groups_finder_spec.rb b/spec/finders/groups/user_groups_finder_spec.rb index f6df396037c..99974896311 100644 --- a/spec/finders/groups/user_groups_finder_spec.rb +++ b/spec/finders/groups/user_groups_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Groups::UserGroupsFinder, feature_category: :subgroups do +RSpec.describe Groups::UserGroupsFinder, feature_category: :groups_and_projects do describe '#execute' do let_it_be(:user) { create(:user) } let_it_be(:root_group) { create(:group, name: 'Root group', path: 'root-group') } diff --git a/spec/finders/members_finder_spec.rb b/spec/finders/members_finder_spec.rb index afab4514ce2..4df6197e3b0 100644 --- a/spec/finders/members_finder_spec.rb +++ b/spec/finders/members_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe MembersFinder, feature_category: :subgroups do +RSpec.describe MembersFinder, feature_category: :groups_and_projects do shared_examples '#execute' do let_it_be(:group) { create(:group) } let_it_be(:nested_group) { create(:group, parent: group) } diff --git a/spec/finders/releases/group_releases_finder_spec.rb b/spec/finders/releases/group_releases_finder_spec.rb index c47477eb3d5..daefc94828b 100644 --- a/spec/finders/releases/group_releases_finder_spec.rb +++ b/spec/finders/releases/group_releases_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Releases::GroupReleasesFinder, feature_category: :subgroups do +RSpec.describe Releases::GroupReleasesFinder, feature_category: :groups_and_projects do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, :repository, group: group) } diff --git a/spec/finders/releases_finder_spec.rb b/spec/finders/releases_finder_spec.rb index a3418f08b7d..f836b430f8c 100644 --- a/spec/finders/releases_finder_spec.rb +++ b/spec/finders/releases_finder_spec.rb @@ -12,17 +12,7 @@ RSpec.describe ReleasesFinder, feature_category: :release_orchestration do let_it_be(:v1_0_0) { create(:release, project: project, tag: 'v1.0.0') } let_it_be(:v1_1_0) { create(:release, project: project, tag: 'v1.1.0') } - shared_examples_for 'when the user is not part of the project' do - it 'returns no releases' do - is_expected.to be_empty - end - end - - shared_examples_for 'when the user is not part of the group' do - before do - allow(Ability).to receive(:allowed?).with(user, :read_release, group).and_return(false) - end - + shared_examples_for 'when the user is not authorized' do it 'returns no releases' do is_expected.to be_empty end @@ -57,9 +47,9 @@ RSpec.describe ReleasesFinder, feature_category: :release_orchestration do describe 'when parent is a project' do subject { described_class.new(project, user, params).execute(**args) } - it_behaves_like 'when the user is not part of the project' + it_behaves_like 'when the user is not authorized' - context 'when the user is a project guest' do + context 'when the user has guest privileges or higher' do before do project.add_guest(user) @@ -109,11 +99,9 @@ RSpec.describe ReleasesFinder, feature_category: :release_orchestration do subject { described_class.new([project, project2], user, params).execute(**args) } - context 'when the user is not part of any project' do - it_behaves_like 'when the user is not part of the project' - end + it_behaves_like 'when the user is not authorized' - context 'when the user is only part of one project' do + context 'when the user has guest privileges or higher on one project' do before do project.add_guest(user) end @@ -125,7 +113,7 @@ RSpec.describe ReleasesFinder, feature_category: :release_orchestration do end end - context 'when the user is a guest on all projects' do + context 'when the user has guest privileges or higher on all projects' do before do project.add_guest(user) project2.add_guest(user) |