diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-29 03:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-29 03:08:36 +0300 |
commit | 1063cd719c0e25df43bf5d2c0ea8e22f112ed225 (patch) | |
tree | 0bdd8d0582bb9cd0d2ca5a6d3ea8ca593465a964 /spec/features/alerts_settings/user_views_alerts_settings_spec.rb | |
parent | 669f67690a43e9ec7b6d148c6ec1391b379fa16e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/alerts_settings/user_views_alerts_settings_spec.rb')
-rw-r--r-- | spec/features/alerts_settings/user_views_alerts_settings_spec.rb | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/spec/features/alerts_settings/user_views_alerts_settings_spec.rb b/spec/features/alerts_settings/user_views_alerts_settings_spec.rb new file mode 100644 index 00000000000..0ded13ae607 --- /dev/null +++ b/spec/features/alerts_settings/user_views_alerts_settings_spec.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Alert integrations settings form', :js do + let_it_be(:project) { create(:project) } + let_it_be(:maintainer) { create(:user) } + let_it_be(:developer) { create(:user) } + + before_all do + project.add_maintainer(maintainer) + project.add_developer(developer) + end + + before do + sign_in(maintainer) + end + + describe 'when viewing alert integrations as a maintainer' do + context 'with feature flag enabled' do + before do + visit project_settings_operations_path(project, anchor: 'js-alert-management-settings') + wait_for_requests + end + + it 'shows the alerts setting form title' do + page.within('#js-alert-management-settings') do + expect(find('h3')).to have_content('Alerts') + end + end + + it 'shows the new alerts setting form' do + expect(page).to have_content('1. Select integration type') + end + end + + context 'with feature flag disabled' do + before do + stub_feature_flags(http_integrations_list: false) + + visit project_settings_operations_path(project, anchor: 'js-alert-management-settings') + wait_for_requests + end + + it 'shows the old alerts setting form' do + expect(page).to have_content('Webhook URL') + end + end + end + + describe 'when viewing alert integrations as a developer' do + before do + sign_in(developer) + + visit project_settings_operations_path(project, anchor: 'js-alert-management-settings') + wait_for_requests + end + + it 'shows the old alerts setting form' do + expect(page).not_to have_selector('.incident-management-list') + expect(page).not_to have_selector('#js-alert-management-settings') + end + end +end |