diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-09-04 18:23:11 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-09-06 18:47:50 +0300 |
commit | d6fa67824d13fc342721e996810f2838d4706fd2 (patch) | |
tree | 9a82614ec32df17b31d348f3c8da2ee8d2f41eb5 /spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb | |
parent | ec9bb1a7deed082ef050a7275df0abd134f526f3 (diff) |
Displays banner to notify users ADO is implicitly enabled
If ADO is implicitly enabled for a project due to the instance wide
setting feature or feature flag rollout then an owner or maintainer
visiting that project are going to see a banner.
Closes #50535
Diffstat (limited to 'spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb')
-rw-r--r-- | spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb b/spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb new file mode 100644 index 00000000000..baf715000a3 --- /dev/null +++ b/spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'Project > Show > User interacts with auto devops implicitly enabled banner' do + let(:project) { create(:project, :repository) } + let(:user) { create(:user) } + + before do + project.add_user(user, role) + sign_in(user) + end + + context 'when user does not have maintainer access' do + let(:role) { :developer } + + context 'when AutoDevOps is implicitly enabled' do + it 'does not display AutoDevOps implicitly enabled banner' do + expect(page).not_to have_css('.auto-devops-implicitly-enabled-banner') + end + end + end + + context 'when user has mantainer access' do + let(:role) { :maintainer } + + context 'when AutoDevOps is implicitly enabled' do + before do + stub_application_setting(auto_devops_enabled: true) + + visit project_path(project) + end + + it 'display AutoDevOps implicitly enabled banner' do + expect(page).to have_css('.auto-devops-implicitly-enabled-banner') + end + + context 'when user dismisses the banner', :js do + it 'does not display AutoDevOps implicitly enabled banner' do + find('.hide-auto-devops-implicitly-enabled-banner').click + wait_for_requests + visit project_path(project) + + expect(page).not_to have_css('.auto-devops-implicitly-enabled-banner') + end + end + end + + context 'when AutoDevOps is not implicitly enabled' do + before do + stub_application_setting(auto_devops_enabled: false) + + visit project_path(project) + end + + it 'does not display AutoDevOps implicitly enabled banner' do + expect(page).not_to have_css('.auto-devops-implicitly-enabled-banner') + end + end + end +end |