diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /spec/support/shared_examples/controllers/instance_statistics_controllers_shared_examples.rb | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) | |
download | gitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'spec/support/shared_examples/controllers/instance_statistics_controllers_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/controllers/instance_statistics_controllers_shared_examples.rb | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/spec/support/shared_examples/controllers/instance_statistics_controllers_shared_examples.rb b/spec/support/shared_examples/controllers/instance_statistics_controllers_shared_examples.rb deleted file mode 100644 index 17087456720..00000000000 --- a/spec/support/shared_examples/controllers/instance_statistics_controllers_shared_examples.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -RSpec.shared_examples 'instance statistics availability' do - let(:user) { create(:user) } - - before do - sign_in(user) - - stub_application_setting(usage_ping_enabled: true) - end - - describe 'GET #index' do - it 'is available when the feature is available publicly' do - get :index - - expect(response).to have_gitlab_http_status(:success) - end - - it 'renders a 404 when the feature is not available publicly' do - stub_application_setting(instance_statistics_visibility_private: true) - - get :index - - expect(response).to have_gitlab_http_status(:not_found) - end - - context 'for admins' do - let(:user) { create(:admin) } - - context 'when admin mode disabled' do - it 'forbids access when the feature is not available publicly' do - stub_application_setting(instance_statistics_visibility_private: true) - - get :index - - expect(response).to have_gitlab_http_status(:not_found) - end - end - - context 'when admin mode enabled', :enable_admin_mode do - it 'allows access when the feature is not available publicly' do - stub_application_setting(instance_statistics_visibility_private: true) - - get :index - - expect(response).to have_gitlab_http_status(:success) - end - end - end - end -end |