From d0aeb5df3d6b06165355b023a25b79c7bd74a27d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 8 Feb 2023 12:10:06 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/features/groups_spec.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'spec/features/groups_spec.rb') diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb index 8806d1c2219..e3ec28f9c65 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -510,6 +510,33 @@ RSpec.describe 'Group', feature_category: :subgroups do end end end + + context 'when in a private group' do + before do + group.update!( + visibility_level: Gitlab::VisibilityLevel::PRIVATE, + project_creation_level: Gitlab::Access::MAINTAINER_PROJECT_ACCESS + ) + end + + context 'when visibility levels have been restricted to private only by an administrator' do + before do + stub_application_setting( + restricted_visibility_levels: [ + Gitlab::VisibilityLevel::PRIVATE + ] + ) + end + + it 'does not display the "New project" button' do + visit group_path(group) + + page.within '[data-testid="group-buttons"]' do + expect(page).not_to have_link('New project') + end + end + end + end end def remove_with_confirm(button_text, confirm_with) -- cgit v1.2.3