diff options
Diffstat (limited to 'spec/features/projects/settings')
-rw-r--r-- | spec/features/projects/settings/operations_settings_spec.rb | 5 | ||||
-rw-r--r-- | spec/features/projects/settings/packages_settings_spec.rb | 38 |
2 files changed, 42 insertions, 1 deletions
diff --git a/spec/features/projects/settings/operations_settings_spec.rb b/spec/features/projects/settings/operations_settings_spec.rb index 878794bd897..de7251db5c9 100644 --- a/spec/features/projects/settings/operations_settings_spec.rb +++ b/spec/features/projects/settings/operations_settings_spec.rb @@ -35,7 +35,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do end it 'renders form for incident management' do - expect(page).to have_selector('h3', text: 'Incidents') + expect(page).to have_selector('h4', text: 'Incidents') end it 'sets correct default values' do @@ -46,11 +46,14 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do it 'updates form values' do check(create_issue) uncheck(send_email) + click_on('No template selected') + click_on('bug') save_form click_expand_incident_management_button expect(find_field(create_issue)).to be_checked + expect(page).to have_selector(:id, 'alert-integration-settings-issue-template', text: 'bug') expect(find_field(send_email)).not_to be_checked end diff --git a/spec/features/projects/settings/packages_settings_spec.rb b/spec/features/projects/settings/packages_settings_spec.rb new file mode 100644 index 00000000000..0b40cbee582 --- /dev/null +++ b/spec/features/projects/settings/packages_settings_spec.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Projects > Settings > Packages', :js do + let(:project) { create(:project) } + let(:user) { create(:user) } + + before do + sign_in(user) + project.add_maintainer(user) + end + + context 'Packages enabled in config' do + before do + allow(Gitlab.config.packages).to receive(:enabled).and_return(true) + end + + it 'displays the packages toggle button' do + visit edit_project_path(project) + + expect(page).to have_content('Packages') + expect(page).to have_selector('input[name="project[packages_enabled]"] + button', visible: true) + end + end + + context 'Packages disabled in config' do + before do + allow(Gitlab.config.packages).to receive(:enabled).and_return(false) + end + + it 'does not show up in UI' do + visit edit_project_path(project) + + expect(page).not_to have_content('Packages') + end + end +end |