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/admin/admin_mode/logout_spec.rb')
-rw-r--r--spec/features/admin/admin_mode/logout_spec.rb76
1 files changed, 27 insertions, 49 deletions
diff --git a/spec/features/admin/admin_mode/logout_spec.rb b/spec/features/admin/admin_mode/logout_spec.rb
index efb4baa8164..58bea5c4b5f 100644
--- a/spec/features/admin/admin_mode/logout_spec.rb
+++ b/spec/features/admin/admin_mode/logout_spec.rb
@@ -9,69 +9,47 @@ RSpec.describe 'Admin Mode Logout', :js do
let(:user) { create(:admin) }
- shared_examples 'combined_menu: feature flag examples' do
- before do
- # TODO: This used to use gitlab_sign_in, instead of sign_in, but that is buggy. See
- # this issue to look into why: https://gitlab.com/gitlab-org/gitlab/-/issues/331851
- sign_in(user)
- gitlab_enable_admin_mode_sign_in(user)
- visit admin_root_path
- end
+ before do
+ # TODO: This used to use gitlab_sign_in, instead of sign_in, but that is buggy. See
+ # this issue to look into why: https://gitlab.com/gitlab-org/gitlab/-/issues/331851
+ sign_in(user)
+ gitlab_enable_admin_mode_sign_in(user)
+ visit admin_root_path
+ end
- it 'disable removes admin mode and redirects to root page' do
- gitlab_disable_admin_mode
+ it 'disable removes admin mode and redirects to root page' do
+ gitlab_disable_admin_mode
- expect(current_path).to eq root_path
+ expect(current_path).to eq root_path
- open_top_nav
+ open_top_nav
- within_top_nav do
- expect(page).to have_link(href: new_admin_session_path)
- end
- end
-
- it 'disable shows flash notice' do
- gitlab_disable_admin_mode
-
- expect(page).to have_selector('.flash-notice')
+ within_top_nav do
+ expect(page).to have_link(href: new_admin_session_path)
end
+ end
- context 'on a read-only instance' do
- before do
- allow(Gitlab::Database).to receive(:read_only?).and_return(true)
- end
-
- it 'disable removes admin mode and redirects to root page' do
- gitlab_disable_admin_mode
-
- expect(current_path).to eq root_path
-
- open_top_nav
+ it 'disable shows flash notice' do
+ gitlab_disable_admin_mode
- within_top_nav do
- expect(page).to have_link(href: new_admin_session_path)
- end
- end
- end
+ expect(page).to have_selector('.flash-notice')
end
- context 'with combined_menu feature flag on' do
- let(:needs_rewrite_for_combined_menu_flag_on) { true }
-
+ context 'on a read-only instance' do
before do
- stub_feature_flags(combined_menu: true)
+ allow(Gitlab::Database).to receive(:read_only?).and_return(true)
end
- it_behaves_like 'combined_menu: feature flag examples'
- end
+ it 'disable removes admin mode and redirects to root page' do
+ gitlab_disable_admin_mode
- context 'with combined_menu feature flag off' do
- let(:needs_rewrite_for_combined_menu_flag_on) { false }
+ expect(current_path).to eq root_path
- before do
- stub_feature_flags(combined_menu: false)
- end
+ open_top_nav
- it_behaves_like 'combined_menu: feature flag examples'
+ within_top_nav do
+ expect(page).to have_link(href: new_admin_session_path)
+ end
+ end
end
end