diff options
Diffstat (limited to 'spec/features/projects/settings')
4 files changed, 53 insertions, 25 deletions
diff --git a/spec/features/projects/settings/pipelines_settings_spec.rb b/spec/features/projects/settings/pipelines_settings_spec.rb index 39c4315bf0f..a64f81430d1 100644 --- a/spec/features/projects/settings/pipelines_settings_spec.rb +++ b/spec/features/projects/settings/pipelines_settings_spec.rb @@ -25,24 +25,6 @@ RSpec.describe "Projects > Settings > Pipelines settings" do context 'for maintainer' do let(:role) { :maintainer } - it 'be allowed to change' do - visit project_settings_ci_cd_path(project) - - fill_in('Test coverage parsing', with: 'coverage_regex') - - page.within '#js-general-pipeline-settings' do - click_on 'Save changes' - end - - expect(page.status_code).to eq(200) - - page.within '#js-general-pipeline-settings' do - expect(page).to have_button('Save changes', disabled: false) - end - - expect(page).to have_field('Test coverage parsing', with: 'coverage_regex') - end - it 'updates auto_cancel_pending_pipelines' do visit project_settings_ci_cd_path(project) 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 diff --git a/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb b/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb index 77be351f3d8..6aa59f72d2a 100644 --- a/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb +++ b/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb @@ -50,7 +50,7 @@ RSpec.describe 'Projects > Settings > User manages merge request settings' do context 'when Pipelines are initially enabled' do it 'shows the Merge Requests settings' do expect(page).to have_content 'Pipelines must succeed' - expect(page).to have_content 'All discussions must be resolved' + expect(page).to have_content 'All threads must be resolved' within('.sharing-permissions-form') do find('.project-feature-controls[data-for="project[project_feature_attributes][merge_requests_access_level]"] .gl-toggle').click @@ -58,7 +58,7 @@ RSpec.describe 'Projects > Settings > User manages merge request settings' do end expect(page).not_to have_content 'Pipelines must succeed' - expect(page).not_to have_content 'All discussions must be resolved' + expect(page).not_to have_content 'All threads must be resolved' end end @@ -70,7 +70,7 @@ RSpec.describe 'Projects > Settings > User manages merge request settings' do it 'shows the Merge Requests settings that do not depend on Builds feature' do expect(page).to have_content 'Pipelines must succeed' - expect(page).to have_content 'All discussions must be resolved' + expect(page).to have_content 'All threads must be resolved' within('.sharing-permissions-form') do find('.project-feature-controls[data-for="project[project_feature_attributes][builds_access_level]"] .gl-toggle').click @@ -78,7 +78,7 @@ RSpec.describe 'Projects > Settings > User manages merge request settings' do end expect(page).to have_content 'Pipelines must succeed' - expect(page).to have_content 'All discussions must be resolved' + expect(page).to have_content 'All threads must be resolved' end end end @@ -91,7 +91,7 @@ RSpec.describe 'Projects > Settings > User manages merge request settings' do it 'does not show the Merge Requests settings' do expect(page).not_to have_content 'Pipelines must succeed' - expect(page).not_to have_content 'All discussions must be resolved' + expect(page).not_to have_content 'All threads must be resolved' within('.sharing-permissions-form') do find('.project-feature-controls[data-for="project[project_feature_attributes][merge_requests_access_level]"] .gl-toggle').click @@ -99,7 +99,7 @@ RSpec.describe 'Projects > Settings > User manages merge request settings' do end expect(page).to have_content 'Pipelines must succeed' - expect(page).to have_content 'All discussions must be resolved' + expect(page).to have_content 'All threads must be resolved' end end diff --git a/spec/features/projects/settings/user_manages_project_members_spec.rb b/spec/features/projects/settings/user_manages_project_members_spec.rb index 2fe06414b32..1d258582b3a 100644 --- a/spec/features/projects/settings/user_manages_project_members_spec.rb +++ b/spec/features/projects/settings/user_manages_project_members_spec.rb @@ -7,7 +7,7 @@ RSpec.describe 'Projects > Settings > User manages project members' do include Spec::Support::Helpers::ModalHelpers let(:group) { create(:group, name: 'OpenSource') } - let(:project) { create(:project) } + let(:project) { create(:project, :with_namespace_settings) } let(:project2) { create(:project) } let(:user) { create(:user) } let(:user_dmitriy) { create(:user, name: 'Dmitriy') } |