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:
Diffstat (limited to 'spec/features/projects/settings/secure_files_settings_spec.rb')
-rw-r--r--spec/features/projects/settings/secure_files_settings_spec.rb46
1 files changed, 46 insertions, 0 deletions
diff --git a/spec/features/projects/settings/secure_files_settings_spec.rb b/spec/features/projects/settings/secure_files_settings_spec.rb
new file mode 100644
index 00000000000..c7c9cafc420
--- /dev/null
+++ b/spec/features/projects/settings/secure_files_settings_spec.rb
@@ -0,0 +1,46 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'Secure Files Settings' do
+ let_it_be(:maintainer) { create(:user) }
+ let_it_be(:project) { create(:project, creator_id: maintainer.id) }
+
+ before_all do
+ project.add_maintainer(maintainer)
+ end
+
+ context 'when the :ci_secure_files feature flag is enabled' do
+ before do
+ stub_feature_flags(ci_secure_files: true)
+
+ sign_in(user)
+ visit project_settings_ci_cd_path(project)
+ end
+
+ context 'authenticated user with admin permissions' do
+ let(:user) { maintainer }
+
+ it 'shows the secure files settings' do
+ expect(page).to have_content('Secure Files')
+ end
+ end
+ end
+
+ context 'when the :ci_secure_files feature flag is disabled' do
+ before do
+ stub_feature_flags(ci_secure_files: false)
+
+ sign_in(user)
+ visit project_settings_ci_cd_path(project)
+ end
+
+ context 'authenticated user with admin permissions' do
+ let(:user) { maintainer }
+
+ it 'does not shows the secure files settings' do
+ expect(page).not_to have_content('Secure Files')
+ end
+ end
+ end
+end