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
context 'for instances without a valid license' do
before do
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
context 'when there are more users than minimum count' do
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
where(users_over_minimum: [-1, 0, 1])
it 'is not permitted' do
expect(subject).to be_falsey
end
with_them do
it { is_expected.to be(users_over_minimum >= 0) }
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