diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2017-09-07 20:39:00 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-09-07 20:39:00 +0300 |
commit | 94680e1448f9e3af3dfc43e33a74609cdc0ecb69 (patch) | |
tree | 93fa89d344919b9e3257d91c708010457161d48f /spec/lib/gitlab/gitaly_client_spec.rb | |
parent | 6cd0ec11095addfa264bf84ba6614b594921b65e (diff) |
Gitaly feature toggles are on by default in development environments
Diffstat (limited to 'spec/lib/gitlab/gitaly_client_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gitaly_client_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gitaly_client_spec.rb b/spec/lib/gitlab/gitaly_client_spec.rb index 921e786a55c..a9b861fcff2 100644 --- a/spec/lib/gitlab/gitaly_client_spec.rb +++ b/spec/lib/gitlab/gitaly_client_spec.rb @@ -102,6 +102,22 @@ describe Gitlab::GitalyClient, skip_gitaly_mock: true do expect(described_class.feature_enabled?(feature_name, status: feature_status)).to be(false) end end + + context "when a feature is not persisted" do + it 'returns false when opt_into_all_features is off' do + allow(Feature).to receive(:persisted?).and_return(false) + allow(described_class).to receive(:opt_into_all_features?).and_return(false) + + expect(described_class.feature_enabled?(feature_name, status: feature_status)).to be(false) + end + + it 'returns true when the override is on' do + allow(Feature).to receive(:persisted?).and_return(false) + allow(described_class).to receive(:opt_into_all_features?).and_return(true) + + expect(described_class.feature_enabled?(feature_name, status: feature_status)).to be(true) + end + end end context 'when the feature_status is OPT_OUT' do |