Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-06 15:06:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-06 15:06:21 +0300
commit63894d59abd34f76f399d755012cdcd32c5b1103 (patch)
treece797c74a93eb5a17c0e906cc7327938dcd2a4a1 /spec/features/projects/user_changes_project_visibility_spec.rb
parentcd15d0e6c32da7f69689c7cff2e90aeda33b8318 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/projects/user_changes_project_visibility_spec.rb')
-rw-r--r--spec/features/projects/user_changes_project_visibility_spec.rb46
1 files changed, 46 insertions, 0 deletions
diff --git a/spec/features/projects/user_changes_project_visibility_spec.rb b/spec/features/projects/user_changes_project_visibility_spec.rb
new file mode 100644
index 00000000000..31da4140d35
--- /dev/null
+++ b/spec/features/projects/user_changes_project_visibility_spec.rb
@@ -0,0 +1,46 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe 'User changes public project visibility', :js do
+ include ProjectForksHelper
+
+ before do
+ fork_project(project, project.owner)
+
+ sign_in(project.owner)
+
+ visit edit_project_path(project)
+ end
+
+ shared_examples 'changing visibility to private' do
+ it 'requires confirmation' do
+ visibility_select = first('.project-feature-controls .select-control')
+ visibility_select.select('Private')
+
+ page.within('#js-shared-permissions') do
+ click_button 'Save changes'
+ end
+
+ find('.js-confirm-danger-input').send_keys(project.path_with_namespace)
+
+ page.within '.modal' do
+ click_button 'Reduce project visibility'
+ end
+
+ expect(page).to have_text("Project '#{project.name}' was successfully updated")
+ end
+ end
+
+ context 'when a project is public' do
+ let(:project) { create(:project, :empty_repo, :public) }
+
+ it_behaves_like 'changing visibility to private'
+ end
+
+ context 'when the project is internal' do
+ let(:project) { create(:project, :empty_repo, :internal) }
+
+ it_behaves_like 'changing visibility to private'
+ end
+end