Commit 30cd7f4d authored by Stan Hu's avatar Stan Hu

Merge branch '6964-geo-unable-to-disable-verification-on-the-secondary' into 'master'

Resolve "Geo: Unable to disable verification on the secondary"

Closes #6964

See merge request gitlab-org/gitlab-ee!6599
parents b00cced7 0e501e9e
---
title: Geo - Allow repository verification to be disabled on a secondary node
merge_request: 6599
author:
type: fixed
...@@ -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