Commit 0dc0a217 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'simplify-application-setting-spec-for-instance_review_permitted' into 'master'

Simplify instance_review_permitted? spec

See merge request gitlab-org/gitlab!39163
parents 97b87392 7f143f73
...@@ -545,26 +545,15 @@ RSpec.describe ApplicationSetting do ...@@ -545,26 +545,15 @@ RSpec.describe ApplicationSetting do
context 'for instances without a valid license' do context 'for instances without a valid license' do
before do before do
allow(License).to receive(:current).and_return(nil) allow(License).to receive(:current).and_return(nil)
expect(Rails.cache).to receive(:fetch).and_return(
::ApplicationSetting::INSTANCE_REVIEW_MIN_USERS + users_over_minimum
)
end end
context 'when there are more users than minimum count' do where(users_over_minimum: [-1, 0, 1])
before do
expect(Rails.cache).to receive(:fetch).and_return(101)
end
it 'is permitted' do
expect(subject).to be_truthy
end
end
context 'when there are less users than minimum count' do
before do
create(:user)
end
it 'is not permitted' do with_them do
expect(subject).to be_falsey it { is_expected.to be(users_over_minimum >= 0) }
end
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment