Use string rather than a symbol as feature flag name

parent b00cced7
...@@ -111,7 +111,7 @@ module Gitlab ...@@ -111,7 +111,7 @@ module Gitlab
end end
def self.repository_verification_enabled? def self.repository_verification_enabled?
feature = Feature.get(:geo_repository_verification) feature = Feature.get('geo_repository_verification')
# If the feature has been set, always evaluate # If the feature has been set, always evaluate
if Feature.persisted?(feature) if Feature.persisted?(feature)
......
...@@ -182,22 +182,18 @@ describe Gitlab::Geo, :geo do ...@@ -182,22 +182,18 @@ describe Gitlab::Geo, :geo do
end end
end end
context "when the feature flag has been set" do context 'when the feature flag has been set' do
before do context 'when the feature flag is set to enabled' do
allow(Feature).to receive(:persisted?).and_return(true)
end
context "when the feature flag is set to enabled" do
it 'returns true' do it 'returns true' do
Feature.enable(:geo_repository_verification) Feature.enable('geo_repository_verification')
expect(described_class.repository_verification_enabled?).to eq true expect(described_class.repository_verification_enabled?).to eq true
end end
end end
context "when the feature flag is set to disabled" do context 'when the feature flag is set to disabled' do
it 'returns false' do it 'returns false' do
Feature.disable(:geo_repository_verification) Feature.disable('geo_repository_verification')
expect(described_class.repository_verification_enabled?).to eq false expect(described_class.repository_verification_enabled?).to eq false
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