Commit d25a2d1c authored by Ash McKenzie's avatar Ash McKenzie

Use more modern Feature.enabled? for lookup

parent f6a5dda9
......@@ -123,14 +123,7 @@ module Gitlab
end
def self.repository_verification_enabled?
feature = ::Feature.get('geo_repository_verification')
# If the feature has been set, always evaluate
if ::Feature.persisted?(feature)
return feature.enabled?
else
true
end
Feature.enabled?('geo_repository_verification', default_enabled: true)
end
def self.allowed_ip?(ip)
......
......@@ -234,7 +234,7 @@ describe Gitlab::Geo, :geo, :request_store do
context 'when the feature flag has been set' do
context 'when the feature flag is set to enabled' do
it 'returns true' do
Feature.enable('geo_repository_verification')
stub_feature_flags(geo_repository_verification: true)
expect(described_class.repository_verification_enabled?).to eq true
end
......@@ -242,7 +242,7 @@ describe Gitlab::Geo, :geo, :request_store do
context 'when the feature flag is set to disabled' do
it 'returns false' do
Feature.disable('geo_repository_verification')
stub_feature_flags(geo_repository_verification: false)
expect(described_class.repository_verification_enabled?).to eq false
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