diff options
| author | Bob Van Landuyt <bob@gitlab.com> | 2019-06-06 08:49:15 +0000 |
|---|---|---|
| committer | Bob Van Landuyt <bob@gitlab.com> | 2019-06-06 08:49:15 +0000 |
| commit | 5c3cab3d0fa5d5b3364523c974322a8a6552d48c (patch) | |
| tree | 0909cc5366de46fd90d1ff0c8d5273c6761851ed /spec/features | |
| parent | 502cbda11ba0c6d798b243ab6f489cd73c7bdeea (diff) | |
| parent | a5efbfc8cbd9c4db21ae728266ed3395453ad21e (diff) | |
| download | gitlab-ce-5c3cab3d0fa5d5b3364523c974322a8a6552d48c.tar.gz | |
Merge branch 'sh-default-visibility-fix' into 'master'
Set project default visibility to max allowed
Closes #62298
See merge request gitlab-org/gitlab-ce!28754
Diffstat (limited to 'spec/features')
| -rw-r--r-- | spec/features/projects/new_project_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/features/projects/new_project_spec.rb b/spec/features/projects/new_project_spec.rb index b54ea929978..033e1afe866 100644 --- a/spec/features/projects/new_project_spec.rb +++ b/spec/features/projects/new_project_spec.rb @@ -63,6 +63,36 @@ describe 'New project' do end end end + + context 'when group visibility is private but default is internal' do + before do + stub_application_setting(default_project_visibility: Gitlab::VisibilityLevel::INTERNAL) + end + + it 'has private selected' do + group = create(:group, visibility_level: Gitlab::VisibilityLevel::PRIVATE) + visit new_project_path(namespace_id: group.id) + + page.within('#blank-project-pane') do + expect(find_field("project_visibility_level_#{Gitlab::VisibilityLevel::PRIVATE}")).to be_checked + end + end + end + + context 'when group visibility is public but user requests private' do + before do + stub_application_setting(default_project_visibility: Gitlab::VisibilityLevel::INTERNAL) + end + + it 'has private selected' do + group = create(:group, visibility_level: Gitlab::VisibilityLevel::PUBLIC) + visit new_project_path(namespace_id: group.id, project: { visibility_level: Gitlab::VisibilityLevel::PRIVATE }) + + page.within('#blank-project-pane') do + expect(find_field("project_visibility_level_#{Gitlab::VisibilityLevel::PRIVATE}")).to be_checked + end + end + end end context 'Readme selector' do |
