From 44fdf983bd35328dd577d3d3650d14163ef3e2b6 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 15 Apr 2020 15:42:17 +0000 Subject: Add latest changes from gitlab-org/gitlab@12-10-stable-ee --- spec/features/explore/groups_spec.rb | 12 ++++++++++++ spec/features/explore/user_explores_projects_spec.rb | 11 +++++++++++ 2 files changed, 23 insertions(+) (limited to 'spec/features') diff --git a/spec/features/explore/groups_spec.rb b/spec/features/explore/groups_spec.rb index eff63d6a788..50ec44580d2 100644 --- a/spec/features/explore/groups_spec.rb +++ b/spec/features/explore/groups_spec.rb @@ -89,5 +89,17 @@ describe 'Explore Groups', :js do end it_behaves_like 'renders group in public groups area' + + context 'when visibility is restricted to public' do + before do + stub_application_setting(restricted_visibility_levels: [Gitlab::VisibilityLevel::PUBLIC]) + end + + it 'redirects to the sign in page' do + visit explore_groups_path + + expect(page).to have_current_path(new_user_session_path) + end + end end end diff --git a/spec/features/explore/user_explores_projects_spec.rb b/spec/features/explore/user_explores_projects_spec.rb index c64709c0b55..6adf51a1cf6 100644 --- a/spec/features/explore/user_explores_projects_spec.rb +++ b/spec/features/explore/user_explores_projects_spec.rb @@ -16,6 +16,17 @@ describe 'User explores projects' do include_examples 'shows public projects' end + + context 'when visibility is restricted to public' do + before do + stub_application_setting(restricted_visibility_levels: [Gitlab::VisibilityLevel::PUBLIC]) + visit(explore_projects_path) + end + + it 'redirects to login page' do + expect(page).to have_current_path(new_user_session_path) + end + end end context 'when signed in' do -- cgit v1.2.3