summaryrefslogtreecommitdiff
path: root/spec/policies
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-08-06 11:52:10 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-08-06 13:33:07 +0200
commitbaffe82ace1ca3ee247c1eee2a5c21aea2256539 (patch)
treef8463f91103e7c8ac7809924c8978cf866b374dd /spec/policies
parent0f871450cd3e77b0a94769a12d2d100a6d093e2c (diff)
downloadgitlab-ce-baffe82ace1ca3ee247c1eee2a5c21aea2256539.tar.gz
Hide instance statistics on new installations
Making the migrations and the default do the right thing in the first place. This makes 20180806094307 a no-op.
Diffstat (limited to 'spec/policies')
-rw-r--r--spec/policies/global_policy_spec.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/policies/global_policy_spec.rb b/spec/policies/global_policy_spec.rb
index 30d68e7dc9d..35f1912c1c8 100644
--- a/spec/policies/global_policy_spec.rb
+++ b/spec/policies/global_policy_spec.rb
@@ -183,7 +183,13 @@ describe GlobalPolicy do
describe 'read instance statistics' do
context 'regular user' do
- it { is_expected.to be_allowed(:read_instance_statistics) }
+ context 'when instance statistics are publicly available' do
+ before do
+ stub_application_setting(instance_statistics_visibility_private: false)
+ end
+
+ it { is_expected.to be_allowed(:read_instance_statistics) }
+ end
context 'when instance statistics are set to private' do
before do
@@ -197,7 +203,13 @@ describe GlobalPolicy do
context 'admin' do
let(:current_user) { create(:admin) }
- it { is_expected.to be_allowed(:read_instance_statistics) }
+ context 'when instance statistics are publicly available' do
+ before do
+ stub_application_setting(instance_statistics_visibility_private: false)
+ end
+
+ it { is_expected.to be_allowed(:read_instance_statistics) }
+ end
context 'when instance statistics are set to private' do
before do